LOG: Calculating the Natural Logarithm
Available Languages: reporting, Maintain
The LOG function returns the natural logarithm of a number.
Calculate the Natural Logarithm
LOG(in_value)
in_value
Numeric
Is the value for which the natural logarithm is calculated, the name of a field that contains the value, or an expression that returns the value. If you supply an expression, use parentheses as needed to ensure the correct order of evaluation. If in_value is less than or equal to 0, LOG returns 0.
Note: LOG does not use an output argument.
The format of the result is floating-point double precision.
Calculating the Natural Logarithm
LOG calculates the logarithm of CURR_SAL.
LOG(CURR_SAL)
For $29,700.00, the result is 10.30.
For $26,862.00, the result is 10.20.
LOG calculates the logarithm of the CURR_SAL field:
TABLE FILE EMPLOYEE PRINT CURR_SAL AND COMPUTE LOG_CURR_SAL/D12.2 = LOG(CURR_SAL);BY LAST_NAME BY FIRST_NAME WHERE DEPARTMENT EQ 'PRODUCTION'; END
The output is:
LAST_NAME FIRST_NAME CURR_SAL LOG_CURR_SAL --------- ---------- -------- ------------ BANNING JOHN $29,700.00 10.30 IRVING JOAN $26,862.00 10.20 MCKNIGHT ROGER $16,100.00 9.69 ROMANS ANTHONY $21,120.00 9.96 SMITH RICHARD $9,500.00 9.16 STEVENS ALFRED $11,000.00 9.31