Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-bugs by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group