I have code : #include <iostream> void fun(double _v) { std::cout<<"_v="<<_v<<std::endl; long long int var=static_cast< long long int >(_v*1000.); std::cout<<"var="<<var<<std::endl; } int main(int ac, char** av) { fun(33.33); return 0; } I try to compile this code on Linux x86_64 with GCC 4.8.2 (g++ test.cpp -o test64), I get result in console: _v=33.33 var=33330 but when I try to compile this code on Linux i686 with GCC 4.8.2 (g++ test.cpp -o test32), I get result in console: _v=33.33 var=33329 But if I replace "long long int var=static_cast< long long int >(_v*1000.);" to "double t = _v*1000.; long int var=static_cast< long long int >(t);" I get the result on Linux i686 with GCC 4.4.5: _v=33.33 var=33330
> get the result on Linux i686 with GCC 4.4.5: Sorry, GCC 4.8.2:
You see the effect of excess precision of a floating point value that cannot be represented exactly. *** This bug has been marked as a duplicate of bug 323 ***