M
Man Seesaw
Hi all,
I've encounter this problem that puzzles me a lot.
Here is the code:
double x = 12.93;
cout << "*100, int = " << static_cast<int>(x * 100.0) << endl;
x *= 100.0;
cout << "*=100, int = " << static_cast<int>(x) << endl;
And it gives me:
*100, int = 1292
*=100, int = 1293
Any explanations?
Thanks in advance.
Best regards,
MS
I've encounter this problem that puzzles me a lot.
Here is the code:
double x = 12.93;
cout << "*100, int = " << static_cast<int>(x * 100.0) << endl;
x *= 100.0;
cout << "*=100, int = " << static_cast<int>(x) << endl;
And it gives me:
*100, int = 1292
*=100, int = 1293
Any explanations?
Thanks in advance.
Best regards,
MS