CBRT
Description
Calculate the cube root of the parameter
Syntax
CBRT(<a>)
Parameters
Parameter | Description |
---|---|
<a> | Floating point parameter |
Return Value
Cubic root of parameter <a>
, a floating point number.
Special Cases
- When
a
is NaN, returns NaN - When
a
is positive infinity, returns Infinity - When
a
is negative infinity, returns -Infinity - When
a
is NULL, returns NULL
Examples
select cbrt(0);
+-------------------------+
| cbrt(cast(0 as DOUBLE)) |
+-------------------------+
| 0.0 |
+-------------------------+
select cbrt(-111);
+----------------------------+
| cbrt(cast(-111 as DOUBLE)) |
+----------------------------+
| -4.805895533705333 |
+----------------------------+
select cbrt(1234);
+----------------------------+
| cbrt(cast(1234 as DOUBLE)) |
+----------------------------+
| 10.726014668827325 |
+----------------------------+
select cbrt(cast('nan' as double));
+------------------------------+
| cbrt(cast('nan' AS DOUBLE)) |
+------------------------------+
| NaN |
+------------------------------+
select cbrt(cast('inf' as double));
+------------------------------+
| cbrt(cast('inf' AS DOUBLE)) |
+------------------------------+
| Infinity |
+------------------------------+
select cbrt(cast('-inf' as double));
+-------------------------------+
| cbrt(cast('-inf' AS DOUBLE)) |
+-------------------------------+
| -Infinity |
+-------------------------------+