This is documentation for Mathematica 5, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

Documentation / Mathematica / The Mathematica Book / Mathematica Reference Guide / Developer Context Objects in Mathematica 5 /

Developer`BitLength

FilledSmallSquare BitLength[n] gives the number of binary bits necessary to represent the integer n.

FilledSmallSquare For positive n, BitLength[n] is effectively an efficient version of Floor[Log[2, n]] + 1.

FilledSmallSquare For negative n it is equivalent to BitLength[BitNot[n]].

FilledSmallSquare See also: IntegerExponent, MantissaExponent.