Math.log2

Math.log2

Math.log2

Function

Binary logarithm. Returns the base 2 logarithm of value.

Syntax

Parameters

ParametersTypeRequiredDefault valueDescription
valueNumberisNonea true number.

Return value

TypeDescription
Int/FloatReturns the base 2 logarithm of value. An Int is returned for integer results, and a Float for non-integer or non-finite results.

Example

Notes

  • Integer results return Int.