JS Built-ins
← Math19 / 215
MathLOG2Eintermediate

Math.LOG2E β€” Math.log2(Math.E)

πŸ“– Usage Example
// Base-2 logarithm of e
Math.LOG2E   // β†’ 1.4426950408...
// Equivalent to: 1 / Math.LN2

Use Math.LOG2E as a precomputed constant for converting natural log values to base-2 logarithms.

Math.LOG2E

Math.log2(Math.E) directly computes logβ‚‚(e) and should equal Math.LOG2E.

Challenge: Verify the relationship between Math.log2 and Math.LOG2E.

πŸ’‘ Hints (2)
  • β€’ Math.log2(x) computes logβ‚‚(x) directly.
  • β€’ Math.LOG2E is a cached constant for this value.