bitLength

bitLength

> Functions

Returns the number of significant bits needed to represent the number x*, that is the position of the highest bit set to 1, plus one. Returns 0 when *x is 0.

For a positive number, the result equals floor(log2(x)) + 1. The function also works on big integers.

Parameters
Return
Note