SQRT()
All functions > MATH > SQRT()
Returns the square root of a number.
Signatures
Square root
Returns: Square root of the input
SQRT(number: T) → DOUBLE sql
| Parameter | Type | Required | Description |
|---|---|---|---|
number | T | Yes | Non-negative floating-point number |
With:
T: Floating-point type (FLOAT, DOUBLE)
Signature notes:
- Only defined for non-negative numbers
- Returns NULL if the input is NULL
- Returns NaN for negative inputs
- To use with integers or decimals, cast explicitly (e.g.
SQRT(2.0E0))
Examples
FeatureQL
SELECT
f1 := SQRT(0.0E0), -- Square root of zero
f2 := SQRT(1.0E0), -- Square root of one
f3 := SQRT(4.0E0), -- Perfect square
f4 := SQRT(25.0E0), -- Another perfect square
f5 := SQRT(2.0E0) -- Irrational result
;Result
| f1 VARCHAR | f2 VARCHAR | f3 VARCHAR | f4 VARCHAR | f5 VARCHAR |
|---|---|---|---|---|
| 0.0 | 1.0 | 2.0 | 5.0 | 1.4142135623730951 |
On this page