Skip to main content

This is documentation for Caché & Ensemble.

For information on converting to InterSystems IRIS, see the InterSystems IRIS Adoption Guide and the InterSystems IRIS In-Place Conversion Guide, both available on the WRC Distributions page (login required).

Previous sectionNext section


Returns the natural logarithm of a number.




number An expression that resolves to a positive number.


The LN function returns the natural logarithm of number. The number value must be a non-zero positive number; all other values generate an <ILLEGAL VALUE> error.

The LN function complements the action of the EXP function, which is sometimes referred to as the antilogarithm.


The following example uses the LN function to calculate the natural logarithm of each of the integers 1 through 10:

FOR x=1 TO 10
PRINT "Natural log of ",x," = ",LN(x)
Copy code to clipboard

See Also