ln

Calculates natural logarithm of x.

ln
(
T
)
(
T x
)

Parameters

T

Argument type.

x T

Argument.

Return Value

Type: Unqual!T

Natural logarithm of x.

Examples

import tanya.math;

assert(isNaN(ln(-7.389f)));
assert(isNaN(ln(-7.389)));
assert(isNaN(ln(-7.389L)));

assert(isInfinity(ln(0.0f)));
assert(isInfinity(ln(0.0)));
assert(isInfinity(ln(0.0L)));

assert(ln(1.0f) == 0.0f);
assert(ln(1.0) == 0.0);
assert(ln(1.0L) == 0.0L);

Meta