CBRT()
All functions > MATH > CBRT()
Returns the cube root of a number.
Signatures
Cube root
Returns: Cube root of the input
CBRT(number: T) → DOUBLE sql
| Parameter | Type | Required | Description |
|---|---|---|---|
number | T | Yes | Floating-point number |
With:
T: Floating-point type (FLOAT, DOUBLE)
Signature notes:
- Defined for all real numbers; the cube root of a negative number is negative
- Returns NULL if the input is NULL
- More numerically stable than
POW(x, 1.0/3.0)for negative numbers
Examples
FeatureQL
SELECT
f1 := CBRT(8.0E0), -- Positive cube root
f2 := CBRT(27.0E0), -- Perfect cube
f3 := CBRT(-8.0E0), -- Negative cube root
f4 := CBRT(1.0E0), -- Cube root of one
f5 := CBRT(0.0E0) -- Cube root of zero
;Result
| f1 VARCHAR | f2 VARCHAR | f3 VARCHAR | f4 VARCHAR | f5 VARCHAR |
|---|---|---|---|---|
| 2.0 | 3.0 | -2.0 | 1.0 | 0.0 |
On this page