DataBasic Reference > Statements and Intrinsic Functions > L > LN Function

Comment on this topic

Documentation Comments

Use this form to comment on this topic. You can also provide any general observations about the Online Documentation, or request that additional information be added in a future release.

RealityV15.1Online Documentation (MoTW) Revision 7

LN Function (DataBasic) (m618703+ln_f.htm)

To

Reality

Version

Topic

Submitted by

Company

Location

Email address

Comment

 

 

LN Function

Calculates logarithms to base 'e'.

Syntax

LN(expression)

Syntax Elements

expression is any valid DataBasic expression or any string, substring, or value; expressed as a variable name, a value, or a string enclosed in quotes.

Operation

LN returns the natural logarithm of expression.

If expression evaluates to a number less than or equal to zero, a warning message displays and a value of zero is returned.

If there is no PRECISION statement in the program, the value is returned rounded to the nearest four decimal places. Otherwise, the number of decimal places returned is as specified by the PRECISION statement.

In each case, the significant decimal places returned are the result of rounding. However, only up to five places are significant. If the PRECISION statement specifies a precision greater than five, trailing zeros are appended to the five significant places so as to returned the numbers of places specified.

Examples

Z = LN(X)

Assigns the natural log of variable X to variable Z.

F = "12"
G = "14"
A = LN(F-G)
PRINT A

Prints a warning message and assigns a zero to variable A, because the expression F-G evaluates to a negative number.

RealityV15.1 (MoTW) Revision 7Comment on this topic