Python‎ > ‎integer‎ > ‎

int.bit_length()

http://www.adilwaseem.com/

Introduction
In this function, Python returns with the bit length of the number.

Syntax
int.bit_length(x)

Parameters
x=number

Example
 >>> 
>>> x=pow(2,55)
>>> x
36028797018963968
>>> x.bit_length()
56
>>> 

Comments