Re: unsafe floats

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: unsafe floats
Дата
Msg-id 13346.1078956808@sss.pgh.pa.us
обсуждение исходный текст
Ответ на unsafe floats  (Dennis Bjorklund <db@zigo.dhs.org>)
Ответы Re: unsafe floats  (Neil Conway <neilc@samurai.com>)
Список pgsql-hackers
Dennis Bjorklund <db@zigo.dhs.org> writes:
> When UNSAFE_FLOATS is defined there is a check that float results are 
> within the min and max limits, which excludes values like 'Infinity', 
> '-Infinity' and 'Nan'.

> Is the above something from the SQL standard or just a bug?

I think it was probably reasonable when the code was written (I'd guess
this goes back to very early 90s).  Nowadays, IEEE float math is nearly
universal, and we would be offering better functionality if we allowed
access to Infinity and Nan by default.  So I'd vote for ripping out the
range check, or at least reversing the default state of UNSAFE_FLOATS.

We might end up with two sets of regression expected files, one for
machines that do not support NaN, but that seems acceptable to me.

A variant idea is to try to get configure to detect Infinity/NaN support
and set UNSAFE_FLOATS only if it's there.  But I don't know if we can do
that without a run-time check, which Peter probably will complain about...
        regards, tom lane


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

Предыдущее
От: Dennis Bjorklund
Дата:
Сообщение: unsafe floats
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: selective statement logging