[問題] math.h vs cmath
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
linux
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
<math.h>,<cmath>
問題(Question):
我以前對cmath的認知是它是包含math.h且更powerful的header
但像pow(int a,int b)若是include<math.h> compiled會過
反而include<cmath>就會有error
後來修正為pow(double a,int b) or pow(int a,double b)則compiled OK
雖然能用但是不太懂為什麼的感覺不是很好
有人能稍微講解一下這兩種使用上的比較和觀念嗎?
謝謝!!
--
→
12/10 18:14, , 1F
12/10 18:14, 1F
→
12/10 18:15, , 2F
12/10 18:15, 2F
→
12/10 18:15, , 3F
12/10 18:15, 3F
→
12/10 18:17, , 4F
12/10 18:17, 4F
→
12/10 18:18, , 5F
12/10 18:18, 5F
→
12/10 18:19, , 6F
12/10 18:19, 6F
→
12/10 18:20, , 7F
12/10 18:20, 7F
→
12/10 18:20, , 8F
12/10 18:20, 8F
→
12/10 18:22, , 9F
12/10 18:22, 9F
→
12/10 18:48, , 10F
12/10 18:48, 10F
→
12/10 18:49, , 11F
12/10 18:49, 11F
→
12/10 18:49, , 12F
12/10 18:49, 12F
→
12/10 19:27, , 13F
12/10 19:27, 13F
→
12/10 20:38, , 14F
12/10 20:38, 14F
看了連結和說明後明瞭多了
感謝各位大大解答~~
※ 編輯: Jeanime 來自: 140.112.41.30 (12/10 21:50)
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章