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.
Examplesopen allclose all
Basic Examples (5)
Log2 gives the logarithm to base 2:
Plot over a subset of the reals:
Plot over a subset of the complexes:
Series expansion shifted from the origin:
Numerical Evaluation (6)
Specific Values (6)
Plot the Log2 function:
Function Properties (10)
Log2 is defined for all positive values:
Log2 is defined for all nonzero complex values:
Function range of Log2:
Log2 is not an analytic function:
Log2 has a branch cut along the negative real axis:
Log2 is monotonic on the positive reals:
Log2 is injective:
Log2 is surjective:
Log2 is neither non-negative nor non-positive:
Log2 has both singularities and discontinuities for x≤0:
Log2 is concave on the positive reals:
Series Expansions (5)
Find the Taylor expansion using Series:
Plots of the first three approximations around :
General term in the series expansion using SeriesCoefficient:
Asymptotic expansions at the branch cut:
Log2 can be applied to power series:
Function Identities and Simplifications (6)
Basic identity for Log2:
Logarithm of a power function simplification:
Simplify logarithms with assumptions:
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:
Wolfram Research (2008), Log2, Wolfram Language function, https://reference.wolfram.com/language/ref/Log2.html.
Wolfram Language. 2008. "Log2." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Log2.html.
Wolfram Language. (2008). Log2. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Log2.html