Home
/
Python 3.11
/
Math
/
log2
Python 3.0
Python 3.9
Python 3.11
Functions
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
Copy
math.log2(x)
See Also
int.bit_length()