SQRT scalar function
The SQRT function returns the square root of a number.
The schema is SYSIBM. (The SYSFUN version of the SQRT function continues to be available.)
-
expression
- An expression that returns a value of any built-in numeric data type. If the argument is decimal floating-point, the operation is performed in decimal floating-point; otherwise, the argument is converted to double-precision floating-point for processing by the function.
If the argument is DECFLOAT(n), the result is DECFLOAT(n); otherwise, the result is a double-precision floating-point number.
The result can be null; if the argument is null, the result is the null value.
Notes
- Results involving DECFLOAT special values: If the argument is a special decimal floating-point value, the rules for general arithmetic operations for decimal floating-point apply. See General arithmetic operation rules for decimal floating-point in Expressions.
Example
Assume that SQUARE is a DECIMAL(2,1) host variable
with a value of 9.0.
VALUES SQRT(:SQUARE)
Returns the approximate value 3.00.