PostgreSQL cbrt() Function

The PostgreSQL cbrt() function returns the cube root of the specified number.

cbrt() Syntax

This is the syntax of the PostgreSQL cbrt() function:

cbrt(numeric_value) -> double precision

Parameters

numeric_value

Required. A number, it can be positive, negative, or zero, and it can be an integer or a decimal.

Return value

The PostgreSQL cbrt() function returns the cube root of the specified argument.

The cbrt() function will return NULL if the argument is NULL.

PostgreSQL will give an error if you supply a parameter that is not a numeric type.

cbrt() Examples

Here are a few examples of the cbrt() function:

SELECT
    cbrt(0) AS "cbrt(0)",
    cbrt(125) AS "cbrt(125)",
    cbrt(-125) AS "cbrt(-125)",
    cbrt(85.184) AS "cbrt(85.184)";
 cbrt(0) | cbrt(125) | cbrt(-125) | cbrt(85.184)
---------+-----------+------------+--------------
       0 |         5 |         -5 |          4.4