Re: real or float4 '=' operator is broken in 7.1.2

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: ddodsworth(at)navtechinc(dot)com, pgsql-bugs(at)postgresql(dot)org
Subject: Re: real or float4 '=' operator is broken in 7.1.2
Date: 2001-07-25 06:45:07
Message-ID: 20266.996043507@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

pgsql-bugs(at)postgresql(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2001-07-25 06:52:44 Re: insert of date is wrong
Previous Message Rainer Mager 2001-07-25 06:34:16 RE: pg_dump doesn't handle CREATE FUNCTIONs well