Re: min() and NaN

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: min() and NaN
Дата
Msg-id 20030719230117.X55138-100000@megazone.bigpanda.com
обсуждение исходный текст
Ответ на min() and NaN  ("Michael S. Tibbetts" <mtibbetts@head-cfa.harvard.edu>)
Список pgsql-sql
On Tue, 15 Jul 2003, Michael S. Tibbetts wrote:

> Hi,
>
> I have a table containing a double precision column. That column
> contains at least one judiciously placed NaN.
>
> I'd expect the aggregate function min() to return the minimum, valid
> numeric value.  Instead, it seems to return the minimum value from the
> subset of rows following the 'NaN'.

This appears to be a bug in the min (and presumably max) aggregate
function for floats.  AFAICT It should use the same logic as the < (or >)
comparison operator for the type (SQL92 6.5 GR2b iii I believe), but it's
just doing a < (or >) in C on the two arguments which isn't the same.

Changing it to follow those rules would give 2.718 for min and it looks
like NaN for max.



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

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: changing an update via rules
Следующее
От: Oleg Bartunov
Дата:
Сообщение: Re: Join table with itself for heirarchial system?