Math.LN2
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
TheMath.LN2 static data property represents the natural logarithm of 2, approximately 0.693:
In this article
Try it
function getNatLog2() { return Math.LN2;}console.log(getNatLog2());// Expected output: 0.6931471805599453Value
Property attributes ofMath.LN2 | |
|---|---|
| Writable | no |
| Enumerable | no |
| Configurable | no |
Description
BecauseLN2 is a static property ofMath, you always use it asMath.LN2, rather than as a property of aMath object you created (Math is not a constructor).
Examples
>Using Math.LN2
The following function returns the natural log of 2:
js
function getNatLog2() { return Math.LN2;}getNatLog2(); // 0.6931471805599453Specifications
| Specification |
|---|
| ECMAScript® 2026 Language Specification> # sec-math.ln2> |