COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
Example 216 SQRT Function
Code:
DATA DIVISION.
WORKING-STORAGE SECTION.
01 A PICTURE S9V99.
PROCEDURE DIVISION.
MOVE FUNCTION SQRT (0) TO A.
DISPLAY A.
MOVE FUNCTION SQRT (25) TO A.
DISPLAY A.
MOVE FUNCTION SQRT (100) TO A.
DISPLAY A.
MOVE FUNCTION SQRT (47) TO A.
DISPLAY A.
MOVE FUNCTION SQRT (7.923) TO A.
DISPLAY A.
Output:
00.000
05.000
10.000
06.855
02.814
STANDARD-DEVIATION Function
STANDARD-DEVIATION, a numeric function, returns a value that approximates the standard
deviation of its arguments.
argument
is a numeric argument.
argument can be an array; for example,
FUNCTION STANDARD-DEVIATION (ARRAY1(ALL))
returns a value that approximates the standard deviation of the elements of the array ARRAY1.
The returned value is the approximation of the standard deviation of the argument series.
If there is only one argument, or if every argument is a variable occurrence data item and the
total number of occurrences for all of them is one, the returned value is zero; otherwise, the returned
value is approximately
where n is the number of arguments.
690 Intrinsic Functions










