#include <math.h>
double exp( double arg );
函数返回参数 returns e (2.7182818) 的 arg 次幂。
#include <stdio.h> #include <math.h> int main(void) { double result; double x = 4.0; result = exp(x); printf("'e' raised to the power \ of %lf (e ^ %lf) = %lf\n", x, x, result); return 0; }
输出结果:
'e' raised to the power of 4.000000 (e ^ 4.000000) = 54.598150