Skip to main content Link Search Menu Expand Document Toggle dark mode Copy Code (external link)

e() : Euler’s Number Constant

Get the mathematical constant e (Euler’s number), approximately 2.71828.


On this page

Signature

e()

Parameters

None.


Returns

Type: Double

The value of e (approximately 2.71828182845905).


Examples

Display Constant

<p>Euler's number: {{format(e(), '0.00000')}}</p>

Output:

<p>Euler's number: 2.71828</p>

Exponential Growth

<p>Result: {{format(model.initial * pow(e(), model.rate * model.time), '0.00')}}</p>

Data:

doc.Params["model"] = new {
    initial = 100,
    rate = 0.05,
    time = 10
};

Output:

<p>Result: 164.87</p>

Natural Exponential

<!-- e^2 using constant vs exp function -->
<p>e^2 = {{format(pow(e(), 2), '0.000')}}</p>
<p>exp(2) = {{format(exp(2), '0.000')}}</p>

Output:

<p>e^2 = 7.389</p>
<p>exp(2) = 7.389</p>

Notes

  • Returns constant value (no parameters)
  • Value: 2.71828182845905…
  • Base of natural logarithms
  • Used in continuous growth/decay models
  • exp(x) is same as pow(e(), x)
  • For Ï€ (pi), use pi()

See Also