JavaScript Math pow()

The JavaScript math pow() method is used to get the value of base to the power of an exponent. Syntax: Math.pow(base,exponent) Parameters base: It represents the base number. exponent: It represents the exponent to which the base has to raise. Returns Base value to the power of exponent. Example: <!DOCTYPE html> <html> <body> <script> document.writeln(Math.pow(2,4)); … Read more

JavaScript math hypot() method

The JavaScript math hypot() method is used to get the square root of the sum of the squares of a set of numbers. Syntax: Math.hypot(n1,n2,..) Parameters n1,n2,..: It represents the set of numbers. Returns The square root of the sum of the squares of a set of numbers Example: <!DOCTYPE html> <html> <body> <script> document.writeln(Math.hypot(2,2,1,4)); … Read more

JavaScript math floor() method

The JavaScript math floor() method is used to get the largest integer value, either lower than or equal to a number. Syntax: Math.floor(n) Parameters n: It represents the number. Returns The largest integer value will be either lower than or equal to the specified number. Example: <!DOCTYPE html> <html> <body> <script> document.writeln(Math.floor(2.7)); </script> </body> </html>

JavaScript math cosh() method

The JavaScript math cosh() method is used to get the hyperbolic cosine of the given number. Syntax: Math.cosh(n) Parameters n: It represents the number whose hyperbolic cosine has to be get. Returns Hyperbolic cosine value of a number Example: <!DOCTYPE html> <html> <body> <script> document.writeln(Math.cosh(0)); </script> </body> </html>