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

log() : Natural Logarithm


On this page

Summary

Calculate the natural logarithm (base e) of a number.

Signature

log(value)

Parameters

Parameter Type Required Description
value Number Yes The number (must be positive)

Returns

Type: Double

The natural logarithm of the value.


Examples

Basic Logarithm

<p>ln() = </p>

Data:

doc.Params["model"] = new {
    value = 10
};

Output:

<p>ln(10) = 2.303</p>

Time to Double

<p>Years to double: </p>

Data:

doc.Params["model"] = new {
    rate = 0.07
};

Output:

<p>Years to double: 9.9</p>

Notes

  • Inverse of exp() function
  • Value must be positive (> 0)
  • Returns double-precision floating-point
  • For base-10 logarithm, use log10()
  • Natural log uses base e ≈ 2.71828

See Also