Doesn't happen on my g++, and doesn't happen on ideone.com's http://ideone.com/JnJAt
could you give your cout a std::setprecision(100) and print the pow() without a cast?
I did, and I had to manually step the program with pauses. I noticed it was perfect powers of 10 until it reached 10^23...However, my code never got to that point originally, what does this mean? I have a fresh install of MingW as of last night as well.
That looks like Windows. Their C library isn't that good on math -- in particular, pow() for integers is nowhere as precise as it could be.
Workaround: add 0.5 before casting to int.
You're right, it's WinXP. And I found a different work around, but I figured this would be more of a precise answer than just multiplying by 10 over and over again.
And I figured that the compiler made the difference with the libraries, not the OS.