Re: [BUGS] BUG #4660: float functions return -0

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [BUGS] BUG #4660: float functions return -0
Date: 2009-02-17 13:04:34
Message-ID: 871vtx2p0d.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

> The CVS commit message says
> Check for zero in unary minus floating point code (IEEE allows an
> explicit negative zero which looks ugly in a query result!).

> I'm of the opinion that minus zero was put into the IEEE floating point
> standard by people who know a great deal more about the topic than
> anyone on this list does, and that we do not have the expertise to be
> second-guessing how it should work. Not long ago we took out code that
> was interfering with spec-compliant treatment of IEEE infinity; I think
> we should take out this code too.

If the original complaint was that it looked ugly in query results then the
right way to fix it would surely in float4out and float8out. Interfering with
IEEE floating points may be a bad idea but surely it's up to us how we want to
represent those values in text.

But without a convenient and widely used binary format that kind of restricts
our options. If we squash -0 on float[48]out then dumps will lose information.
So I guess there's nothing we can do about it now. I wonder if we're going to
find users complaining about things like "displaying -0 matching results"
though...

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
Ask me about EnterpriseDB's Slony Replication support!

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Alvaro Herrera 2009-02-17 15:55:25 Re: BUG #4658: copy problem
Previous Message Bruce Momjian 2009-02-17 12:55:45 Re: [BUGS] BUG #4660: float functions return -0

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2009-02-17 15:09:52 Re: differnce from ansi sql standard - unicode strings?
Previous Message Bruce Momjian 2009-02-17 12:55:45 Re: [BUGS] BUG #4660: float functions return -0