🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #320

Re: IEEE zero problem

#320
From: Paul Eggert
Date: Sat, 08 Aug 1992 16:13
9 lines
994 bytes
   This behaviour is not correct, becauses there are two values of x which
   equal 0.0 in IEEE fp math, and the optimizer erroneously thinks there is
   only one.  The IEEE defn also asserts that -0. < 0.

No, the IEEE 754 standard says that -0.0 == 0.0, and that !(-0.0 < 0.0).
You cannot directly distinguish -0.0 from 0.0 with a standard comparison op;
you can distinguish them only by printing them out, or by performing some
other arithmetic operations on them (e.g. 1/x) and comparing the results.
So GCC is acting correctly in the cases that you cite.
Technical Details
Message-ID: <9208081613.AA25714@bi.twinsun.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!bi.TWinsun.COM!eggert
References: <9208062351.AA28887@garnet.bmr.gov.au>

Show Full Headers
Complete Article Headers
Newsgroups: gnu.gcc.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!bi.TWinsun.COM!eggert
From: eggert@bi.TWinsun.COM (Paul Eggert)
Subject: Re: IEEE zero problem
Message-ID: <9208081613.AA25714@bi.twinsun.com>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
References: <9208062351.AA28887@garnet.bmr.gov.au>
Distribution: gnu
Date: Sat, 8 Aug 1992 16:13:17 GMT
Approved: bug-gcc@prep.ai.mit.edu
Lines: 10