C90 | double exp (double x); |
C99 | double exp (double x);
float expf (float x); long double expl (long double x); |
C++98 | double exp (double x);
float exp (float x); long double exp (long double x); |
C++11 | double exp (double x);
float exp (float x); long double exp (long double x); double exp (T x); // additional overloads for integral types |
C99 | 头文件<tgmath.h> 提供了该函数的泛型类型宏版本。 |
C++98 | 这个函数在<complex>和<valarray> 中重载(参见complex exp和valarray exp)。 |
C++11 | 这个头文件(<cmath>) 为整型提供了额外的重载:这些重载在计算之前将x转换为double.
这个函数在<complex>和<valarray> 中也重载(参见complex exp和valarray exp)。 |
C90(C++98) | 如果发生范围溢出错误,全局变量errno将被设置为ERANGE。 |
C99(C++11) | 如果出现范围溢出错误:
-并且math_errhandling设置了MATH_ERRNO: 全局变量errno设置为ERANGE. -并且math_errhandling设置了MATH_ERREXCEPT: 触发 FE_OVERFLOW . |
/* exp example */ #include <stdio.h> /* printf */ #include <math.h> /* exp */ int main () { double param, result; param = 5.0; result = exp (param); printf ("The exponential value of %f is %f.\n", param, result ); return 0; } |
log | 计算自然对数(function ) |
pow | 次幂(function ) |