Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Mathematics and Algorithms > Mathematical Functions > Elementary Functions >

Log2

Log2[x]
gives the base-2 logarithm of x.
  • Mathematical function, suitable for both symbolic and numerical manipulation.
  • Log2 gives exact integer or rational number results when possible.
  • For certain special arguments, Log2 automatically evaluates to exact values.
  • Log2 can be evaluated to arbitrary numerical precision.
  • Log2 automatically threads over lists.
Evaluate for complex argument:
Evaluate to arbitrary precision:
The precision of the output tracks the precision of the input:
Log2 threads element-wise over lists:
TraditionalForm formatting:
Worst-case complexity of merge sort algorithm from its functional equation:
Best-case complexity of merge sort algorithm:
Bubble sort is asymptotically worse than merge sort:
Find the age of a sample in units of its half-life time:
Compute the number of bits needed to store a large integer:
Compare to the exact result:
Number of bits used to represent Mathematica's machine reals:
Simplification with assumptions:
New in 7
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team