I have a doubt concerning the output of the following C program. I tried to compile it using both Visual C++ 6.0 and MinGW32 (gcc 3.4.2).
#include
Visual C++ 6.0 was released last century, and I believe it predates standard C++. It is wholly unsurprising that VC++ 6.0 exhibits broken behaviour.
You'll also note that gcc-3.4.2 is from 2004. Indeed, you're using a 32-bit compiler. gcc on x86 plays rather fast and loose with floating-point math. This may technically be justified by the C standard if gcc sets FLT_EVAL_METHOD
to something nonzero.