LOG function
Calculates the logarithm of an expression using a specified base and returns that logarithm as a DECIMAL value.
Syntax
expression
base
A numeric expression that is the base you want to use. If you do not specify a base, LOG returns the natural logarithm, base (e). The base must be greater than 1.
Example
This procedure prompts the user for a base and a number, and then displays the log of the number. The VALIDATE option on the UPDATE statement ensures that the user enters a base value greater than 1 and a number greater than 0.
Notes
- The LOG function is accurate to approximately 10 decimal places.
- After converting the base and exponent to floating-point format, the LOG function uses standard system routines. On some machines, the logarithm routines do not handle large numbers well and might cause your terminal to hang.