Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Mathematics and Algorithms > Discrete Mathematics > Boolean Computation > Bitwise Operations > BitLength >
Mathematica > Mathematics and Algorithms > Logic & Boolean Algebra > Boolean Computation > Bitwise Operations > BitLength >
Mathematica > Mathematics and Algorithms > Graphs & Networks > Graph Programming > Boolean Computation > Bitwise Operations > BitLength >

BitLength

BitLength[n]
gives the number of binary bits necessary to represent the integer n.
  • For positive n, BitLength[n] is effectively an efficient version of Floor[Log[2, n]]+1.
Plot it:
In[1]:=
Click for copyable input
Out[1]=
 
Plot it:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
New in 6
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF