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
some of you guys said that it's a optimization bug, but i am kind of disagree. i think it's a reasonable floating point precision error and a good example showing people how floating point works.
http://ideone.com/Ssw8GR
maybe OP could try to paste my program into your computer and try to compile with your compiler and see what happens. or try:
http://ideone.com/OGypBC
(with explicit float conversion).
anyway, if we calculate the error, it's 4.656612875245797e-10
that much, and should be considered as pretty precise.
it could relate to the preference of printf
too.