COBOL Manual for TNS and TNS/R Programs
Intrinsic Functions
HP COBOL Manual for TNS and TNS/R Programs—522555-006
14-27
LOG10 Function
LOG10 Function
LOG10, a numeric function, returns a value that approximates the logarithm to the
base 10 of its argument.
argument
is a numeric argument greater than zero.
The returned value is approximately the logarithm to the base 10 of the value of
argument.
Note. This function requires the CRE. To use this function in a TNS HP COBOL program,
compile the program with the directive ENV COMMON.
Example 14-19. LOG10 Function
Code:
DATA DIVISION.
WORKING-STORAGE SECTION.
01 A PICTURE S9V99.
PROCEDURE DIVISION.
MOVE FUNCTION LOG10 (1) TO A.
DISPLAY A.
MOVE FUNCTION LOG10 (10) TO A.
DISPLAY A.
MOVE FUNCTION LOG10 (100) TO A.
DISPLAY A.
MOVE FUNCTION LOG10 (1000) TO A.
DISPLAY A.
MOVE FUNCTION LOG10 (10000) TO A.
DISPLAY A.
Output:
0.00
1.00
2.00
3.00
4.00
( )
LOG10FUNCTION argument
VST437.vsd