ID EN
Math

log2

Python 3.11

Return the base-2 logarithm of x. This is usually more accurate than log(x, 2).

Syntax

PYTHON
math.log2(x)

See Also

int.bit_length()