Re: Issue with point_ops and NaN

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, rjuju123(at)gmail(dot)com
Cc: tgl(at)sss(dot)pgh(dot)pa(dot)us, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Issue with point_ops and NaN
Date: 2021-03-31 10:01:08
Message-ID: 89a3bc71863baeaa6f504c941548faf59fa05d30.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Julien Rouhaud 2021-03-31 10:12:56 Re: SQL-standard function body
Previous Message Etsuro Fujita 2021-03-31 09:55:22 Re: Asynchronous Append on postgres_fdw nodes.