Loading...
Select Version
The LOG function returns a numeric value that approximates the logarithm to the base e (natural log) of argument-1.
The type of this function is numeric.
Format
FUNCTION LOG (argument-1)
Arguments
argument-1 must be class "numeric".
The value of argument-1 must be greater than zero.
Returned values
The returned value is the approximation of the logarithm to the base e of argument-1.
The error default value is
-9’999’999’999’999’999’999’999’999’999’999.
See also: LOG10, FACTORIAL, SQRT
Example 9-21
...
DATA DIVISION.
WORKING-STORAGE SECTION.
01 L PIC S99V999 VALUE 3.
01 R PIC S99V999999.
01 RES PIC 99.999999.
PROCEDURE DIVISION.
P1 SECTION.
MAIN.
COMPUTE R = FUNCTION LOG (L).
MOVE R TO RES.
DISPLAY RES UPON T.
STOP RUN.
Result: 01.098612