cbrt, cbrtf, cbrtl
Berechnet die Kubikwurzel.
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 );
Parameter
- x
Gleitkommawert
Rückgabewert
Die cbrt-Funktion gibt die Kubikwurzel von x zurück.
Eingabe |
SEH-Ausnahme |
_matherr-Ausnahme |
---|---|---|
± ∞, QNAN, IND |
Keine |
Keine |
Hinweise
Da C++ das Überladen zulässt, können Sie Überladungen von cbrt aufrufen, die float oder long double-Typen verwenden. In einem C-Programm verwendet cbrt immer double und gibt diesen Wert zurück.
Anforderungen
Funktion |
C-Header |
C++-Header |
---|---|---|
cbrt, cbrtf, cbrtl |
<math.h> |
<cmath> |
Zusätzliche Informationen zur Kompatibilität finden Sie unter Kompatibilität.
Beispiel
// 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);
}
.NET Framework-Entsprechung
Nicht zutreffend. Mit PInvoke rufen Sie die Standard-C-Funktion auf. Weitere Informationen finden Sie unter Beispiele für Plattformaufrufe.