c語言pow用法

轉自:http://zhidao.baidu.com/link?url=4QHcN_LHiPOITGb94NOx1lRV6V-MmztWA5pNEuGDLPTajCZbFpvxXEbKv-ABoKeuCanBDrna2CQSsTKqOvl62q

原型:extern float pow(float x, float y); 

  用法:#include <math.h> 

  功能:計算x的y次冪。 

  說明:x應大於零,返回冪指數的結果。 

  舉例: 

  // pow.c 

  #include <syslib.h> 

  #include <math.h> 

  main() 

  { 

  clrscr(); // clear screen 

  textmode(0x00); // 6 lines per LCD screen 

  printf("4^5=%f",pow(4.,5.)); 

  getchar(); 

  return 0; 

  }
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章