Re: Issue with point_ops and NaN - Mailing list pgsql-hackers

From Kyotaro Horiguchi
Subject Re: Issue with point_ops and NaN
Date
Msg-id 20210401.093532.1729854908787410242.horikyota.ntt@gmail.com
Whole thread Raw
In response to Re: Issue with point_ops and NaN  (Laurenz Albe <laurenz.albe@cybertec.at>)
Responses Re: Issue with point_ops and NaN
List pgsql-hackers
At Wed, 31 Mar 2021 12:01:08 +0200, Laurenz Albe <laurenz.albe@cybertec.at> wrote in 
> On Wed, 2021-03-31 at 15:48 +0900, Kyotaro Horiguchi wrote:
> > > > > > > SELECT point('NaN','NaN') <@ polygon('(0,0),(1,0),(1,1),(0,0)');
> > > > > > > ?column? 
> > > > > > > ----------
> > > > > > >   t
> > > > > > >   (1 row)
> > > > > 
> > > > > Agreed --- one could make an argument for either 'false' or NULL
> > > > > result, but surely not 'true'.
> > 
> > Thanks! However, Michael's suggestion is worth considering.  What do
> > you think about makeing NaN-involved comparison return NULL?  If you
> > agree to that, I'll make a further change to the patch.
> 
> If you think of "NaN" literally as "not a number", then FALSE would
> make sense, since "not a number" implies "not a number between 0 and 1".
> 
> But since NaN is the result of operations like 0/0 or infinity - infinity,
> NULL might be better.
> 
> So I'd opt for NULL too.

Thanks.  Do you think it's acceptable that returning false instead of
NULL as an alternative behavior?

regards.

-- 
Kyotaro Horiguchi
NTT Open Source Software Center



pgsql-hackers by date:

Previous
From: Kyotaro Horiguchi
Date:
Subject: Re: Issue with point_ops and NaN
Next
From: Michael Paquier
Date:
Subject: Re: invalid data in file backup_label problem on windows