函數名: exp
頭檔:<math.h>
函數原型: double exp(double x);
功 能: 求底數e的x次方
參數: double x 為要操作的指數
傳回值: 傳回底數e的x的次方值
注意: 自然數e為常數2.71828
程式例: 求底數e的x次方值,並將結果輸出
#include<stdio.h>#include<math.h>intmain(void){doubleresult;doublex=4.0;result=exp(x);printf('e'raisedtothepowerof%lf(e^%lf)=%lf n,x,x,result);return0;}
運行結果:
'e'raisedtothepowerof4.000000(e^4.000000)=54.598150