log2

log2

> Functions

Calculates the logarithm in base 2 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