Found 8862 Articles for Front End Technology

Math.log2() function in JavaScript

Samual Sam
Updated on 25-Jun-2020 12:27:45

53 Views

The log2() function of the Math object accepts a number and returns the natural logarithm (base 2) of the given number.SyntaxIts Syntax is as followsMath.log2(48);Example Live Demo    JavaScript Example           var result = Math.log2(48);       document.write("Result: "+result);     OutputResult: 5.584962500721156

Math.log1p() function in JavaScript

karthikeya Boyini
Updated on 25-Jun-2020 12:28:08

45 Views

The log1p() function of the Math object accepts a number and returns the natural logarithm (base E) of the (given number+1).SyntaxIts Syntax is as followsMath.log1p(48);Example Live Demo    JavaScript Example           var result = Math.log1p(48);       document.write("Result: "+result);     OutputResult: 3.8918202981106265

Math.log10() function in JavaScript

Samual Sam
Updated on 25-Jun-2020 12:28:31

99 Views

The log10() function of the Math object accepts a number and returns the natural logarithm (base 10) of the given number.SyntaxIts Syntax is as followsMath.log10(48);Example Live Demo    JavaScript Example           var result = Math.log10(48);       document.write("Result: "+result);     OutputResult: 1.6812412373755872

Math.imul() function in JavaScript

Samual Sam
Updated on 25-Jun-2020 12:30:30

61 Views

The imul() function of the Math object accepts two numbers and returns the result of C-like 32-bit multiplication of the given numbers.SyntaxIts Syntax is as followsMath.imul(47, 56);Example Live Demo    JavaScript Example           var result = Math.imul(47, 56);       document.write("Result: "+result);     OutputResult: 2632

Math. hypot() function in JavaScript

karthikeya Boyini
Updated on 25-Jun-2020 12:30:51

120 Views

The hypot() function of the Math object accepts numbers and returns the square root of the sum of squares of the given numbers.SyntaxIts Syntax is as followsMath.hypot(12, 58, 66);Example Live Demo    JavaScript Example           var result = Math.hypot(12, 58, 66);       document.write("hypot value: "+result);     Outputhypot value: 88.67919710958147

Math. fround() function in JavaScript

Samual Sam
Updated on 25-Jun-2020 12:33:05

196 Views

The fround() function of the Math object accepts a floating point number and returns the nearest 32-bit single precision float representation of a Number. If the given number itself is an integer this function returns the same.SyntaxIts Syntax is as followsMath.fround(160.98)Example Live Demo    JavaScript Example           var result = Math.fround(160.98);       document.write("Fround value: "+result);     OutputFround value: 160.97999572753906

Math.expm1() function in JavaScript

Samual Sam
Updated on 25-Jun-2020 12:22:53

43 Views

This function of the Math object returns the value of ex – 1, where x and e are the base and exponents of natural algorithms.SyntaxIts Syntax is as followsMath.expm1(6);Example Live Demo    JavaScript Example           var result = Math.expm1(6);       document.write("Result: "+result);     OutputResult: 402.4287934927351

Math.clz32() function in JavaScript

Samual Sam
Updated on 25-Jun-2020 12:23:40

52 Views

The clz32() function of the Math object returns the number of zero bits in the starting of the 32-bit binary representation of a number.SyntaxIts Syntax is as followsMath.clz32(31)Example Live Demo    JavaScript Example           var result = Math.clz32(31);       document.write("Result: "+result);     OutputResult: 27

Math.cbrt() function in JavaScript

Samual Sam
Updated on 25-Jun-2020 12:24:27

44 Views

The cbrt() function of the Math object accepts a number and returns its cube root.SyntaxIts Syntax is as followsMath.cbrt(729)Example    JavaScript Example           var result = Math.cbrt(729));       document.write("");       document.write("Cube root of the given number: "+result);     OutputCube root of the given number: 9

Math.atanh() function in JavaScript

Samual Sam
Updated on 25-Jun-2020 12:25:19

24 Views

The atanh() function of the Math object accepts a number and returns its hyperbolic arc arctangent value in radians. To convert the resultant value into degrees, multiply it with 180 and divide the result by 3.14159 (pi value).SyntaxIts Syntax is as followsMath.atanh(0.5)Example Live Demo    JavaScript Example           var result = Math.atanh(0.5);       document.write("arctangent value: "+result);       document.write("");       document.write("hyperbolic arctangent value in degrees: "+result*180/Math.PI);     Outputarctangent value: 0.5493061443340548 arctangent value in degrees: 31.47292373094538

Advertisements