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>

JavaScript math ceil() method

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

JavaScript math atan() method

The JavaScript math atan() method is used to get the arc-tangent of the given number in radians. It returns the value between -Math.PI/2 to Math.PI/2. Syntax: Math.atan(n) Parameters n: It represents the number whose arc-tangent has to be get. Returns Arc-tangent value of a number Example: <!DOCTYPE html> <html> <body> <script> document.writeln(Math.atan(0)); </script> </body> </html>