# Difference between revisions of "LOG"

Jump to navigation
Jump to search

imported>Aoeu |
imported>Aoeu |
||

Line 9: | Line 9: | ||

* Value parameter MUST be greater than 0! | * Value parameter MUST be greater than 0! | ||

* The natural logarithm is the logarithm to the base '''e = 2.718282''' (approximately). | * The natural logarithm is the logarithm to the base '''e = 2.718282''' (approximately). | ||

− | * The natural logarithm of a is defined as the integral from 1 to a of dx/x. | + | * The natural logarithm of 'a' is defined as the integral from 1 to 'a' of dx/x. |

* Returns are default [[SINGLE]] precision unless the value parameter uses [[DOUBLE]] precision. | * Returns are default [[SINGLE]] precision unless the value parameter uses [[DOUBLE]] precision. | ||

## Revision as of 02:16, 17 March 2010

The **LOG** math function returns the natural logarithm of a specified numerical value.

*Syntax:* logarithm = LOG(value)

- Value parameter MUST be greater than 0!
- The natural logarithm is the logarithm to the base
**e = 2.718282**(approximately). - The natural logarithm of 'a' is defined as the integral from 1 to 'a' of dx/x.
- Returns are default SINGLE precision unless the value parameter uses DOUBLE precision.

*Example:* FUNCTION to find the base ten logarithm or a numerical value.

- FUNCTION Log10#(value AS DOUBLE) STATIC
- Log10# = LOG(value) / LOG(10.#)

- END FUNCTION

*Explanation:* The natural logarithm of the value is divided by the base 10 logarithm. The LOG of ten is designated as a DOUBLE precision return by using # after the 10 value.

*See also:* EXP