JavaScript Math.log2()
JavaScript Math.log2()
The Math.log2() method is used to return the logarithm to the base 2 of a number.
Syntax:-
Its syntax is:- Math.log2(x)
Return:-
Its return is:- number representing the logarithm to the base 2 of the number
Further Explanation:-
Parameter | Description |
---|---|
x | Required. A number. |