JavaScript - math methods

revision:


list of math methods and description.

abs() : returns the absolute value of a number.

acos() : returns the arccosine (in radians) of a number.

asin() : returns the arcsine (in radians) of a number.

atan() : returns the arctangent (in radians) of a number.

atan2() : returns the arctangent of the quotient of its arguments.

ceil() : returns the smallest integer greater than or equal to a number.

cos() : returns the cosine of a number.

exp() : returns EN, where N is the argument, and E is Euler's constant, the base of the natural logarithm.

floor() : returns the largest integer less than or equal to a number.

log() : returns the natural logarithm (base E) of a number.

max() : returns the largest of zero or more numbers.

min() : returns the smallest of zero or more numbers.

pow() : returns base to the exponent power, that is, base exponent.

random() : returns a pseudo-random number between 0 and 1.

round() : returns the value of a number rounded to the nearest integer.

sin() : returns the sine of a number.

sqrt() : returns the square root of a number.

tan() : returns the tangent of a number.

toSource() : returns the string "Math".


examples

code:
                <div>
                    <p id="math1"></p>
                    <p id="math2"></p>
                    <p id="math3"></p>
                    <p id="math4"></p>
                    <p id="math5"></p>
                    <p id="math6"></p>
                    <p id="math7"></p>
                    <p id="math8"></p>
                    <p id="math9"></p>
                    <p id="math10"></p>
                    <p id="math11"></p>
                    <p id="math12"></p>
                    <p id="math13"></p>
                    <p id="math14"></p>
                    <p id="math15"></p>
                    <p id="math16"></p>
                    <p id="math17"></p>
                    <p id="math18"></p>
                    <p id="math19"></p>
                    <p id="math20"></p>
                 </div>
         
                 <script>
                     document.getElementById("math1").innerHTML = "abs() : " + Math.abs(-7.25);
                     document.getElementById("math2").innerHTML = "acos() : " + Math.acos(1);
                     document.getElementById("math3").innerHTML = "acosh() : " + Math.acosh(1);
                     document.getElementById("math4").innerHTML = "asin() : " + Math.asin(1);
                     document.getElementById("math5").innerHTML = "asinh() : " + Math.asinh(1);
                     document.getElementById("math6").innerHTML = "atan() : " + Math.atan(1);
                     document.getElementById("math7").innerHTML = "atan2() : " + Math.atan2(1);
                     document.getElementById("math8").innerHTML = "atanh() : " + Math.atanh(1);
                     document.getElementById("math9").innerHTML = "cbrt() : " + Math.cbrt(1);
                     document.getElementById("math10").innerHTML = "clz32() : " + Math.clz32(1);
                     document.getElementById("math11").innerHTML = "cos() : " + Math.cos(1);
                     document.getElementById("math12").innerHTML = "cosh() : " + Math.cosh(1);
                     document.getElementById("math13").innerHTML = "exp() : " + Math.exp(1);
                     document.getElementById("math14").innerHTML = "floor() : " + Math.floor(1);
                     document.getElementById("math15").innerHTML = "fround() : " + Math.fround(1);
                     document.getElementById("math16").innerHTML = "log10() : " + Math.log10(1);
                     document.getElementById("math17").innerHTML = "pow() : " + Math.pow(1,4);
                     document.getElementById("math18").innerHTML = "random() : " + Math.random();
                     document.getElementById("math19").innerHTML = "sign() : " + Math.sign(1);
                     document.getElementById("math20").innerHTML = "sqrt() : " + Math.sqrt(1);
         
                 </script>