Home C&C++函数库 c++ 语法 程序源码 Linux C库

cbrt

函数  <cmath> <ctgmath>

C99 double cbrt (double x);
float cbrtf (float x);
long double cbrtl (long double x);
C++11 double cbrt (double x);
float cbrt (float x);
long double cbrt (long double x);
double cbrt (T x);     // additional overloads for integral types

计算立方根
返回x的立方根。
C99 头文件<tgmath.h> 提供了该函数的泛型类型宏版本。
C++11 这个头文件(<cmath>)为整型提供了额外的重载:这些重载在计算之前将x转换为double (在T是任何整型时定义)。

☲  参数


x
计算其立方根。

☉  返回值



x的立方根

☣  示例



/* cbrt example */
#include <stdio.h>      /* printf */
#include <math.h>       /* cbrt */

int main ()
{
  double param, result;
  param = 27.0;
  result = cbrt (param);
  printf ("cbrt (%f) = %f\n", param, result);
  return 0;
}

输出:
cbrt (27.000000) = 3.000000

🍄  另请参阅



sqrt 计算平方根(function )
pow 计算幂(function )

联系我们 免责声明 关于CandCplus 网站地图