Skip to main content Link Search Menu Expand Document (external link)

e() : Euler’s Number Constant


On this page

Summary

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

Signature

e()

Parameters

None.


Returns

Type: Double

The value of e (approximately 2.71828182845905).


Examples

Display Constant

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

Output:

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

Exponential Growth

<p>Result: </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 = </p>
<p>exp(2) = </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