C exp() 声明
exp()
的函数声明是:
double exp(double x);
数学中的 ex
在 C 编程中等于 exp(x)
。
exp() 参数
exp()
接受一个参数。
- x - 一个 double 类型的值。
exp() 返回值
exp()
函数返回一个 double 类型的值。
exp()
函数定义在 <math.h> 头文件中。
示例:C exp() 函数
#include <math.h>
#include <stdio.h>
int main() {
double x = 12.0, result;
result = exp(x);
printf("Exponential of %.2lf = %.2lf", x, result);
return 0;
}
输出
Enter the value of x to find e^x: 12 Exponential of 12.00 = 162754.79