commands → ln

ln(x)

The ln command computes the natural logarithm of a numeric value x, that is, the logarithm to the base exp(1). When x is a floating point number a floating point result is computed, otherwise the result is an exact symbolic value.

Examples

# hardware floating point
ln(2.0);
	0.693147180559945

# symbolic
ln(2);
	ln(2)

Algorithm

In extended precision ln(x) is computed via Newton's method, inversing the exponential function exp(x).

References

Gullberg, Jan. Mathematics: From the Birth of Numbers. Norton, 1996.