Fast implementation/approximation of pow() function in C/C++
生活随笔
收集整理的這篇文章主要介紹了
Fast implementation/approximation of pow() function in C/C++
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
老外的帖子
Sure - it's easy if you have exponential and natural log functions.
Since?y = x^n, you can take the natural log of both sides:
ln(y) = n*ln(x)Then taking the exponential of both sides gives you what you want:
y = exp(n*ln(x))If you want something better, the best place I know to look is?Abramowitz and Stegun.
總結
以上是生活随笔為你收集整理的Fast implementation/approximation of pow() function in C/C++的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: C++共享变量机制
- 下一篇: 斐波那契数列取模(大数)分治算法