Math.sqrt()

WE can get square root of any number by using sqrt() math function. Syntax is here
Math.sqrt(x) ;
We will see some examples.
<script language='JavaScript' type='text/JavaScript'>
<!--
document.write(Math.sqrt(4)); // output is 2
document.write("<br>");
document.write(Math.sqrt(64)); // output is 8
document.write("<br>");
document.write(Math.sqrt(9)); // output is 3
document.write("<br>");
document.write(Math.sqrt(27)); // output is 5.196152422706632
document.write("<br>");
document.write(Math.sqrt(0.36)); // output is 0.6
document.write("<br>------------<br>");
document.write(Math.sqrt(-64)); // output is Nan
document.write("<br>");
document.write(Math.sqrt(-9)); // output is NaN
//-->
</script>
exp() to get E to the power x value
JavaScript Math Reference
Subscribe to our YouTube Channel here


Subscribe

* indicates required
Subscribe to plus2net

    plus2net.com







    Post your comments , suggestion , error , requirements etc here




    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2024 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer