On Fri, Aug 07, 2009 at 07:48:15PM +0100, Greg Stark wrote: > On Fri, Aug 7, 2009 at 7:13 PM, Tom Lane<t...@sss.pgh.pa.us> wrote: > > Underflow. x!=y does not imply (x-y) != 0, if x and y are sufficiently > > small and close together. The difference could underflow to zero. > > Actually I don't think subtraction can underflow with IEEE floats but > I don't think we want to count on IEEE floats everywhere. Even if we > did there's the risk on intel that FPeq() gets called on values which > have just been calculated and are still in registers but then get > spilled to RAM and lose precision before the division happens.
If it does one subtraction in registers you can be reasonably certain the other will be, either way just doing the subtraction and explicitly testing if it's zero will do the right thing--the semantics of C are bad but not that bad. -- Sam http://samason.me.uk/ -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers