Re: Should "select 'nan'::float = 'nan'::float;" return false as per IEEE 754

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема Re: Should "select 'nan'::float = 'nan'::float;" return false as per IEEE 754
Дата
Msg-id CAEYLb_Wi3X6yKxz34o1=XR3_fu59dZxNf4+_-7bg7PDtCKtqgQ@mail.gmail.com
обсуждение исходный текст
Ответ на Should "select 'nan'::float = 'nan'::float;" return false as per IEEE 754  (Hannu Krosing <hannu@2ndQuadrant.com>)
Список pgsql-hackers
On 28 October 2012 09:43, Hannu Krosing <hannu@2ndquadrant.com> wrote:
> test=# select 'NaN'::float = 'NaN'::float as must_be_false;
>  must_be_false
> ----------
>  t
> (1 row)
>
> I think that PostgreSQL's behaviour of comparing two
> NaN-s as equal is wrong and Iwe should follow the IEEE 754 spec here

The reason that PostgreSQL does this is that in order for float to be
a btree indexable type, its semantics must follow the reflexive law.
This and other requirements of btree operator classes are described
under src/backend/access/nbtree/README.

-- 
Peter Geoghegan       http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training and Services



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

Предыдущее
От: Thomas Munro
Дата:
Сообщение: Re: Should "select 'nan'::float = 'nan'::float;" return false as per IEEE 754
Следующее
От: Greg Stark
Дата:
Сообщение: Re: Logical to physical page mapping