Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我必须将一个数字提高到 1/2.2 的幂,即 0.45454545... 很多次。实际上,我必须循环执行此操作。简单的 pow/powf 非常慢(当我从循环代码中注释掉这个 pow 时,它会更快)。有没有办法优化这样的操作?
你可以看看:Optimized Approximative pow() in C / C++
它还包括一个基准。