Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

If all you're doing is just squaring a variable, there's no need to haul in a fancy math function. I'd just replace std::pow(radius, 2) with radius*radius. This is done all the time in real-world code. The compiler will handle this faster, not having to look up "pow()". You may even be able to ditch use of <cmath> if there's no other math functions or constants in use, reducing dependencies