ln

Typefunction
DictionaryLCS
LibraryLiveCode Script
Syntax
the ln of <number>
ln(<number>)
Summary

Returns the natural logarithm of a number.

Introduced1.0
OSmac, windows, linux, ios, android
Platformsdesktop, server, mobile
Parameters
NameTypeDescription
number

A positive number, or an expression that evaluates to a positive number.

Example
ln(1) -- returns zero
ln(0.15) -- returns -1.89712
ln(10) -- returns 2.302585
Values
NameTypeDescription
return

The ln function returns a number.

RelatedControl Structure: function
Glossary: return, math operation
Function: ln1, exp
Description

Use the ln function to obtain a base e logarithm.

The natural logarithm of a number is the power to which e must be raised to obtain the number.

The transcendental number e appears in many mathematical formulas.

To find the logarithm of a number in any base, use the following function:

function logarithm theBase,theNumber
    return ln(theNumber)/ln(theBase)
end logarithm

If a math operation on finite inputs produces a non-finite output, an execution error is thrown. See math operations for more information.

Tagsmath