log2

log2(number number) → real log2
Computes the base-2 logarithm of given number.

Calculates the base 2 logarithm of the number number.

Parameters
Return
Python

In Python, math.log2() is the native function of the math module: if number <= 0, it raises a ValueError (math domain error) instead of returning NaN as LeekScript does.

Examples

log2(1) // 0.0 log2(10) // 3.3219280948873626 log2(16) // 4.0