cbrt
Computes the cube root of the argument.
This function is supported from v3.3 onwards.
Syntaxβ
DOUBLE cbrt(DOUBLE arg)
Parametersβ
arg
: You can specify only a numeric value. This function converts the numeric value into a DOUBLE value before it computes the cube root of the value.
Return valueβ
Returns a value of the DOUBLE data type. If you specify a non-numeric value, this function returns NULL
.
Examplesβ
mysql> select cbrt(8);
+---------+
| cbrt(8) |
+---------+
| 2 |
+---------+
mysql> select cbrt(-8);
+----------+
| cbrt(-8) |
+----------+
| -2 |
+----------+
mysql> select cbrt(0);
+---------+
| cbrt(0) |
+---------+
| 0 |
+---------+
mysql> select cbrt("");
+----------+
| cbrt('') |
+----------+
| NULL |
+----------+
keywordsβ
cbrt, cube root