SQRT: Calculating the Square Root
Available Languages: reporting, Maintain
The SQRT function calculates the square root of a number.
Calculate the Square Root
SQRT(in_value)
in_value
Numeric
Is the value for which the square root 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 you supply a negative number, the result is zero.
Note: SQRT does not use an output argument.
The result of the function is floating-point double precision.
Calculating the Square Root
SQRT calculates the square root of LISTPR.
SQRT(LISTPR)
For 19.98, the result is 4.47.
For 14.98, the result is 3.87.
SQRT calculates the square root of LISTPR:
TABLE FILE MOVIES PRINT LISTPR AND COMPUTE SQRT_LISTPR/D12.2 = SQRT(LISTPR);BY TITLE WHERE CATEGORY EQ 'MUSICALS'; END
The output is:
TITLE LISTPR SQRT_LISTPR ----- ------ ----------- ALL THAT JAZZ 19.98 4.47 CABARET 19.98 4.47 CHORUS LINE, A 14.98 3.87 FIDDLER ON THE ROOF 29.95 5.47