Code [GCC compiled with -O2 flag]
int main() { vector< vector<int> > matrixa(8); int ff = 5; int s = pow(ff, matrixa.size()); int ss = pow(double(ff), int(matrixa.size())); vector< vector<int> > comb(s); cout << ff << "^" << matrixa.size() << " = " << s << endl; cout << ss << endl; return 0; }
Output
5^8 = 390624 390625
I am wondering why s = 390624 , when should it be 390625 . If I compile code without the -O2 flag, then s = 390625 . Also, casting for ss seems to fix the problem.
What's happening?
My OS is Windows 7 Ultimate x64. Not sure about the GCC version, it comes with the code :: Blocks 10.05.
source share