gcc strangeness

Dmitry Morozovsky marck at rinet.ru
Sun Jul 11 11:07:30 PDT 2004


On Sun, 11 Jul 2004, Dimitry Andric wrote:

DA> > 1.000000 1.000 0
DA> > 2.000000 2.000 1
DA> > 3.000000 3.000 2
DA> > 4.000000 4.000 3
DA> > 5.000000 5.000 5
DA> > 6.000000 6.000 6
DA> > 7.000000 7.000 7
DA> > 8.000000 8.000 7
DA> > 9.000000 9.000 8
DA> > 9.999999 10.000 9
DA>
DA> Yes, this is completely normal if you use IEEE floating point, due to
DA> decimal <-> binary conversion and other accumulating rounding errors.
DA> In other words, floating point calculations will almost never be
DA> exact...
DA>
DA> This is not a gcc problem.  In fact, I can even reproduce your output
DA> under Windows using a Microsoft C compiler! :)

Wow, it's interesting for us to have exact step-by-step instructions for that!
;)

Sincerely,
D.Marck                                     [DM5020, MCK-RIPE, DM3-RIPN]
------------------------------------------------------------------------
*** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck at rinet.ru ***
------------------------------------------------------------------------


More information about the freebsd-hackers mailing list