Compartir a través de


cbrt, cbrtf, cbrtl

Calcula la raíz cúbica.

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 );

Parámetros

  • x
    Valor de punto flotante

Valor devuelto

Las funciones cbrt devuelven la raíz cúbica de x.

Entrada

Excepción SEH

Excepción de _matherr

± ∞, QNAN, IND

ninguna

ninguna

Comentarios

Como C++ permite las sobrecargas, puede llamar a las sobrecargas de cbrt que toman los tipos float y long double. En un programa C, cbrt siempre toma y devuelve un tipo double.

Requisitos

Función

Encabezado C

Encabezado C++

cbrt, cbrtf, cbrtl

<math.h>

<cmath>

Para obtener información adicional de compatibilidad, vea Compatibilidad.

Ejemplo

// 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);
}
  

Equivalente en .NET Framework

No es aplicable. Para llamar a la función estándar de C, use PInvoke. Para obtener más información, vea Ejemplos de invocación de plataforma.

Vea también

Referencia

Compatibilidad con el punto flotante

exp, expf

log, logf, log10, log10f

pow, powf, powl