Loading...
Select Version
The SQRT function returns a numeric value that approximates the square root of argument-1.
The type of this function is numeric.
Format
FUNCTION
SQRT
(argument-1)
Arguments
argument-1 must be class "numeric".
The value of argument-1 must be zero or positive.
Returned values
The returned value is the absolute value of the approximation of the square root of argument-1.
The error default value is
-
2.
See also: FACTORIAL, LOG, LOG10
Example 9-42
... DATA DIVISION. WORKING-STORAGE SECTION. 01 R PIC 99V999999. 01 RES PIC 99.999999. PROCEDURE DIVISION. P1 SECTION. MAIN. COMPUTE R = FUNCTION SQRT (33). MOVE R TO RES. DISPLAY RES UPON T. STOP RUN.
Result: 05.744562