I saw this old question about std::pow
: What is more efficient? Using pow to square or just multiply it with itself?
The old question mentions std::pow
has a variant that is std::pow(double, int)
and some users said this version might be faster.
Is std::pow(double, int)
faster than std::pow(double, double)
? if yes, how much faster?
p.s. standard boilerplate disclaimer about "I already know that premature optimization is evil, but I'm asking this optimization question for academic purposes or I've already identified that line/block of code as a bottleneck"