Answers for "math javascript"

14

javascript math methods

abs(x)	Returns the absolute value of x
acos(x)	Returns the arccosine of x, in radians
acosh(x)	Returns the hyperbolic arccosine of x
asin(x)	Returns the arcsine of x, in radians
asinh(x)	Returns the hyperbolic arcsine of x
atan(x)	Returns the arctangent of x as a numeric value between -PI/2 and PI/2 radians
atan2(y, x)	Returns the arctangent of the quotient of its arguments
atanh(x)	Returns the hyperbolic arctangent of x
cbrt(x)	Returns the cubic root of x
ceil(x)	Returns x, rounded upwards to the nearest integer
cos(x)	Returns the cosine of x (x is in radians)
cosh(x)	Returns the hyperbolic cosine of x
exp(x)	Returns the value of Ex
floor(x)	Returns x, rounded downwards to the nearest integer
log(x)	Returns the natural logarithm (base E) of x
max(x, y, z, ..., n)	Returns the number with the highest value
min(x, y, z, ..., n)	Returns the number with the lowest value
pow(x, y)	Returns the value of x to the power of y
random()	Returns a random number between 0 and 1
round(x)	Rounds x to the nearest integer
sin(x)	Returns the sine of x (x is in radians)
sinh(x)	Returns the hyperbolic sine of x
sqrt(x)	Returns the square root of x
tan(x)	Returns the tangent of an angle
tanh(x)	Returns the hyperbolic tangent of a number
trunc(x)	Returns the integer part of a number (x)
Posted by: Guest on January-04-2021
0

math javascript

Math.ceil(4.9);     // returns 5

Math.ceil(4.7);     // returns 5

Math.ceil(4.4);     // returns 5

Math.ceil(4.2);     // returns 5

Math.ceil(-4.2);     // returns -4
Posted by: Guest on August-11-2021
0

math javascript

Math.round(4.9);    // returns 5

Math.round(4.7);    // returns 5

Math.round(4.4);    // returns 4

Math.round(4.2);    // returns 4

Math.round(-4.2);    // returns -4
Posted by: Guest on August-11-2021
0

math javascript

Math.sign(-4);    // returns -1

Math.sign(0);    // returns 0

Math.sign(4);    // returns 1
Posted by: Guest on August-11-2021
0

math javascript

Math.trunc(4.9);    // returns 4

Math.trunc(4.7);    // returns 4

Math.trunc(4.4);    // returns 4

Math.trunc(4.2);    // returns 4

Math.trunc(-4.2);    // returns -4
Posted by: Guest on August-11-2021
0

math javascript

Math.floor(4.9);    // returns 4

Math.floor(4.7);    // returns 4

Math.floor(4.4);    // returns 4

Math.floor(4.2);    // returns 4

Math.floor(-4.2);    // returns -5
Posted by: Guest on August-11-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language