pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: jeremie.thomassey@gmail.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #6675: Box overlap with infinity edge
Date: Wed, 06 Jun 2012 00:58:48 -0400
Message-ID: <6245.1338958728@sss.pgh.pa.us> (raw)
In-Reply-To: <E1Sbnz8-0003X0-Hs@wrigleys.postgresql.org>
References: <E1Sbnz8-0003X0-Hs@wrigleys.postgresql.org>

jeremie.thomassey@gmail.com writes:
> I can't understand this result :

> SELECT box '((1,1),(infinity, 1))' && box '((2, 1),(infinity, 1))';
>  ?column? 
> ---------
>  f

> Isn't it supposed to return true? The documentation doesn't really say
> anything about infinite edge.

The test for this involves

	FPge(box1->high.x, box2->high.x)

where FPge is defined as 

	#define FPge(A,B)    ((B) - (A) <= EPSILON)

When both high.x values are infinity, you have infinity minus infinity,
which yields NaN in IEEE arithmetic, so the comparison to epsilon comes
out false.

In general I don't think we promise that geometric operations involving
infinite endpoints will behave sanely.  There are probably a boatload
of corner cases besides this one that'd need to be fixed before we
could consider that a supported case.

			regards, tom lane



view thread (2+ messages)

Message-ID: <6245.1338958728@sss.pgh.pa.us>
Permalink:  ../6245.1338958728@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/6245.1338958728@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, jeremie.thomassey@gmail.com
  Subject: Re: BUG #6675: Box overlap with infinity edge
  In-Reply-To: <6245.1338958728@sss.pgh.pa.us>
  References: <E1Sbnz8-0003X0-Hs@wrigleys.postgresql.org> <6245.1338958728@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox