In a code using `pow(double x, double p)` (a big part of the cases have `p = 2.0`) I observed than the execution of my code is clearly faster when `p = 2.0` than when `p = 2.000000001`. I conclude that, on my compiler (gcc 4.8.5), the implementation of `pow` detects when it's a square at runtime.

Following this observation, I conclude that I don't need a specific implementation when I know that p is 2. But my code must be cross-platform, then my question:

**Is `pow` optimized when the exponent is an integer in most of the c++03 compilers ?** 

*In my current context, "most of the compiler" = "gcc >= 4.8, intel with msvc, intel on unix"*