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

Поиск
Список
Период
Сортировка
От Gregory Stark
Тема Re: [BUGS] BUG #4660: float functions return -0
Дата
Msg-id 871vtx2p0d.fsf@oxford.xeocode.com
обсуждение исходный текст
Ответ на Re: [BUGS] BUG #4660: float functions return -0  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [BUGS] BUG #4660: float functions return -0
Список pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.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!


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [BUGS] BUG #4660: float functions return -0
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: differnce from ansi sql standard - unicode strings?