cbrt, cbrtf, cbrtl

Calcola la radice cubica.

Sintassi

double cbrt(
   double x
);
float cbrt(
   float x
);  // C++ only
long double cbrt(
   long double x
);  // C++ only
float cbrtf(
   float x
);
long double cbrtl(
   long double x
);
#define cbrt(X) // Requires C11 or higher

Parametri

x
Valore a virgola mobile

Valore restituito

La funzione cbrt restituisce la radice cubica di x.

Input Eccezione SEH Eccezione _matherr
± INF, QNaN, IND Nessuno Nessuno

Osservazioni:

Poiché C++ consente l'overload, è possibile chiamare overload di cbrt che accettino tipi float e long double. In un programma C, a meno che non si usi la <macro tgmath.h> per chiamare questa funzione, cbrt accetta sempre e restituisce double.

Se si utilizza la <macro tgmath.h>cbrt() , il tipo dell'argomento determina quale versione della funzione è selezionata. Per informazioni dettagliate, vedere La matematica generica dei tipi.

Per impostazione predefinita, lo stato globale di questa funzione è limitato all'applicazione. Per modificare questo comportamento, vedere Stato globale in CRT.

Requisiti

Funzione Intestazione C Intestazione C++
cbrt, cbrtf, cbrtl <math.h> <cmath>
cbrt Macro <tgmath.h>

Per altre informazioni sulla compatibilità, vedere Compatibility (Compatibilità).

Esempio

// crt_cbrt.c
// Compile using: cl /W4 crt_cbrt.c
// This program calculates a cube root.

#include <math.h>
#include <stdio.h>

int main( void )
{
   double question = -64.64;
   double answer;

   answer = cbrt(question);
   printf("The cube root of %.2f is %.6f\n", question, answer);
}
The cube root of -64.64 is -4.013289

Vedi anche

Supporto matematico e a virgola mobile
exp, expf, expl
log, logf, log10, log10f
pow, powf, powl