extern float pow(float x, float y)
成都創(chuàng)新互聯(lián)公司專注為客戶提供全方位的互聯(lián)網(wǎng)綜合服務(wù),包含不限于成都網(wǎng)站制作、成都網(wǎng)站設(shè)計、宜興網(wǎng)絡(luò)推廣、微信小程序、宜興網(wǎng)絡(luò)營銷、宜興企業(yè)策劃、宜興品牌公關(guān)、搜索引擎seo、人物專訪、企業(yè)宣傳片、企業(yè)代運營等,從售前售中售后,我們都將竭誠為您服務(wù),您的肯定,是我們最大的嘉獎;成都創(chuàng)新互聯(lián)公司為所有大學(xué)生創(chuàng)業(yè)者提供宜興建站搭建服務(wù),24小時服務(wù)熱線:13518219792,官方網(wǎng)址:chinadenli.net
用法:#include math.h
功能:計算x的y次冪。
說明:x應(yīng)大于零,返回冪指數(shù)的結(jié)果。
舉例:
// pow.c
#include stdlib.h
#include math.h
#include conio.h
void main()
{
printf("4^5=%f",pow(4.,5.));
getchar();
}
相關(guān)函數(shù):pow10
C語言是一門通用計算機編程語言,應(yīng)用廣泛。C語言的設(shè)計目標(biāo)是提供一種能以簡易的方式編譯、處理低級存儲器、產(chǎn)生少量的機器碼以及不需要任何運行環(huán)境支持便能運行的編程語言。
函數(shù)名: pow
功 能: 指數(shù)函數(shù)(x的y次方)
用 法: double pow(double x, double y);
程序例:
#include
#include
int main(void)
{
double x = 2.0, y = 3.0;
printf("%lf raised to %lf is %lf\n", x, y, pow(x, y));
return 0;
}
函數(shù)名: pow10
功 能: 指數(shù)函數(shù)(10的p次方)
用 法: double pow10(int p);
程序例:
#include
#include
int main(void)
{
double p = 3.0;
printf("Ten raised to %lf is %lf\n", p, pow10(p));
return 0;
}
當(dāng)然是math.h呀,kwgrg給出的原型太有意思,C中函數(shù)還可以重載倒是第一次聽說
C語言中的數(shù)學(xué)函數(shù):pow原型:在TC2.0中原型為extern float pow(float x, float y); ,而在VC6.0中原型為double pow( double x, double y );
頭文件:math.h
功能:計算x的y次冪。
返回值:x應(yīng)大于零,返回冪指數(shù)的結(jié)果。
返回類型:double型,int,float會給與警告!
舉例1:(在VC6.0中運行通過)
#include math.h
#include stdio.h
int main(void)
{
double x = 2.0, y = 3.0;
printf("%lf raised to %lf is %lf\n", x, y, pow(x, y));
return 0;
}
原型:extern float pow(float x, float y);
用法:#include math.h
功能:計算x的y次冪。
說明:x應(yīng)大于零,返回冪指數(shù)的結(jié)果。
舉例:
// pow.c
#include stdlib.h
#include math.h
#include conio.h
void main()
{
printf("4^5=%f",pow(4.,5.));
getchar();
}
相關(guān)函數(shù):pow10
網(wǎng)站題目:c語言冪函數(shù)能用 c語言冪運算函數(shù)
新聞來源:http://chinadenli.net/article30/hpeipo.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站排名、響應(yīng)式網(wǎng)站、虛擬主機、電子商務(wù)、搜索引擎優(yōu)化、用戶體驗
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)