LOG or LN (Logarithm)

The LOG, or LN, function returns the natural logarithm of a number.

Syntax

LOG ( number )

or

LN ( number )

Remarks

The Number argument can be any valid numeric expression that results in a value greater than 0. The natural logarithm is the logarithm to the base e. The constant e is approximately 2.718282. You can calculate base-n logarithms for any number x by dividing the natural logarithm of x by the natural logarithm of n as follows:

LOGN( x ) = LOG( x ) / LOG( n )

A ClosedNAN Not a number. A data word indicating a measurement or processing error. Voltage overrange, SDI-12 sensor error, and undefined mathematical results can produce NAN. is returned if Number is a NAN or equal to/less than 0.

CRBasic uses base e for both Log and LN.