Matlab vs C++ Double Precision
I am porting some code from Matlab to C++. In Matlab format long D = 0.689655172413793 (this is 1.0 / 1.45) E = 2600 / D // I get E = 3.770000000000e+03 In C++ double D = 0.68965517241379315; //(this is 1.0 / 1.45) double E = 2600 / D; //I get E = 3769.9999999999995 It is a problem for me because in both cases I have to do rounding down to 0 (Matlab's fix), and in the first case (Matlab) is becomes 3770, whereas in the second case (C++) it becomes 3769. I realise that it is because of the two additional least significant digits "15" in the C++ case. Given that Matlab seems to only store up to