Math : Object
Math Methods
Returns the number of leading 0
bits in the 32 bit unsigned integer representation of x
.
Example:
RunResults:
Returns length of a vector with components [x
, y
, ...]. This is the square root of the sum of the squares of the components.
Example:
RunResults:
Returns the product of x
and y
treating both values as 32 bit integer values and truncating the result to a 32 bit integer value.
Example:
RunResults:
Returns the natural logarithm (base e) of x
. To compute the logarithm with respect to a different base b
, use the formula Math.log(x) / Math.log(b)
. For base 10, you can use Math.log(x) * Math.LOG10E
(or log10()
with ECMAScript 2015). For base 2, you can use Math.log(x) * Math.LOG2E
(or log2()
with ECMAScript 2015). See also exp()
and log1p()
.
Example:
RunResults:
Returns a random number between 0
(inclusive) and 1
(exclusive). See also crypto.getRandomValues().