Re: real or float4 '=' operator is broken in 7.1.2 - Mailing list pgsql-bugs

From Tom Lane
Subject Re: real or float4 '=' operator is broken in 7.1.2
Date
Msg-id 20266.996043507@sss.pgh.pa.us
Whole thread Raw
In response to real or float4 '=' operator is broken in 7.1.2  (pgsql-bugs@postgresql.org)
List pgsql-bugs
pgsql-bugs@postgresql.org writes:
> real or float4 '=' operator is broken in 7.1.2

No, it isn't --- try coercing the values you are comparing against
to be float4.  Your error is in assuming that 29.92::float8 should
equal 29.92::float4 coerced back to float8.  Which might be a nice
property to have, but it's not the real behavior of real floating-
point arithmetics.

            regards, tom lane

pgsql-bugs by date:

Previous
From: "Rainer Mager"
Date:
Subject: RE: pg_dump doesn't handle CREATE FUNCTIONs well
Next
From: Tom Lane
Date:
Subject: Re: insert of date is wrong