cbrt(), cbrtf(), cbrtl() — Calculate the cube root

Standards

Standards / Extensions C or C++ Dependencies
XPG4.2
C99
Single UNIX Specification, Version 3
C++ TR1 C99
both  

Format

#define _XOPEN_SOURCE_EXTENDED 1
#include <math.h>

double cbrt(double x);
C99:
#define _ISOC99_SOURCE
#include <math.h>

float cbrtf(float x);
long double cbrtl(long double x);
C++ TR1 C99:
#define _TR1_C99
#include <math.h>

float cbrt(float x); 
long double cbrt(long double x);

General description

The cbrt() function calculates the real cube root of its argument x.
Note: The following table shows which functions work in IEEE Binary Floating-Point format and which work in hexadecimal floating-point format. See IEEE binary floating-point for more information about IEEE Binary Floating-Point.
Function Hex IEEE
cbrt X X
cbrtf X X
cbrtl X X

Returned value

The cbrt functions return x to the 1/3 power.

cbrt() does not fail.

Related information