From: Greg C. <gch...@sb...> - 2013-02-18 14:28:40
|
On 2013-02-18 08:26Z, Daniel Carrion wrote: > > The issue was the REAL program outputs to 3 decimal places. I.e. I was > getting rounding of 1.890 instead of 1.889. As mentioned, I don't get this > issue when using MinGW 4.7.2. There was obviously something going on with > my 4.6 version I was using previously. For the floating constant in your original test case: snprintf(buf,17,"%.17f",1.8895); the C standard [6.4.4.2/3] allows the compiler to choose a value either slightly higher, or slightly lower, than the unrepresentable exact value. This value can round either to 1.890 or to 1.889 . |