Re: Should "select 'nan'::float = 'nan'::float;" return false as per IEEE 754
От | Chris Corbyn |
---|---|
Тема | Re: Should "select 'nan'::float = 'nan'::float;" return false as per IEEE 754 |
Дата | |
Msg-id | 8345C6AE-84B9-4EE4-B85A-94C6144F5EC3@w3style.co.uk обсуждение исходный текст |
Ответ на | Should "select 'nan'::float = 'nan'::float;" return false as per IEEE 754 (Hannu Krosing <hannu@2ndQuadrant.com>) |
Ответы |
Re: Should "select 'nan'::float = 'nan'::float;" return
false as per IEEE 754
|
Список | pgsql-hackers |
Would this introduce problems finding rows where the stored value is NaN? You'd need to add a function or operator to avoidthat. Il giorno 28/ott/2012, alle ore 20:43, Hannu Krosing ha scritto: > This is how PostgreSQL currently works - > > 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 > > As per IEEE 754 a NaN behaves similar to NULL in SQL. > > There is some discussion of why it is so at: > > http://stackoverflow.com/questions/1565164/what-is-the-rationale-for-all-comparisons-returning-false-for-ieee754-nan-values > > especially the first comment > > --------- > Hannu > > > -- > Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-hackers
В списке pgsql-hackers по дате отправления: