Skip to content

Lb ​

The binary logarithm of z, identical to Log2.

✓ checked against that system · ! checked, with disagreements (hover a chip)WikipediaBinary logarithmMathWorldBinaryLogarithmWikidataQ581168Wolfram LanguageLog2✓
Lb(z)the base-2 logarithm of z, log⁡2(z)\log_2(z).
SageMathlog(z, 2)✓SymPylog(z, 2)mpmathlog(z, 2)Juliaenumeratio_ball(_log2, z)Rustlog2(z)
Typed signatures
TypePackageApplies
(number) -> numbercompute-enginealways

Domain: Elementary functions

Details
  • An alias for Log2 -- the "lb" notation is borrowed from information theory and computer science, as opposed to "lg" for base 10.
  • Lb\mathrm{Lb} is the binary logarithm, identical to Log2.

Plot

Examples

Basic #
live ↗
Inlog⁡2(8)\log_{2}(8)Out33
live ↗
Inlog⁡2(1)\log_{2}(1)Out00
live ↗
Inlog⁡2(1 024)\log_{2}(1\,024)Out1010

A machine-precision argument evaluates numerically

live ↗
Inlog⁡2(1.414 2)\log_{2}(1.414\,2)Out0.499 986 164 421 874 256 4670.499\,986\,164\,421\,874\,256\,467
live ↗
Inlog⁡2(210)\log_{2}(2^{10})Out1010
Scope #

Same exact negative power fold as Log2: lb⁡18=−3\operatorname{lb}\tfrac18 = -3

live ↗
Inlog⁡2(18)\log_{2}(\frac{1}{8})Out−3-3
live ↗
Inlog⁡2(0)\log_{2}(0)Out−∞-∞

Threads element-wise over a list

live ↗
Inlog⁡2([1,2,4,8])\log_{2}(\bigl\lbrack1, 2, 4, 8\bigr\rbrack)Out[0,1,2,3]\bigl\lbrack0, 1, 2, 3\bigr\rbrack

Same as Log2: the logarithm of complex infinity is +∞+\infty

live ↗
Inlog⁡2(∞~)\log_{2}(\tilde∞)Out∞∞
Properties #

Identical to Log2

live ↗
Inlog⁡2(64)=log⁡2(64)\log_{2}(64)=\log_{2}(64)OutTrue\mathrm{True}
About
Examples10
Checked againstWolfram Language 10 agreeSageMath 10 agreeSymPy 8 agree2 differmpmath 9 agreeJulia 8 agree1 errorRust 8 agree1 error
CrosswalkWikipediaMathWorldWikidataWolfram LanguageSageMathSymPympmathJuliaRust

Implementation

mappedsympypackages/oracle/src/mappings.ts
mappedmpmathpackages/oracle/src/mappings.ts
mappedsagepackages/oracle/src/mappings.ts
mappedjuliapackages/oracle/src/mappings.ts
mappedrustpackages/oracle/src/mappings.ts

See also: Log2, Log, Log10