Re: line_perp() (?-|) is broken.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: emre(at)hasegeli(dot)com
Cc: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: line_perp() (?-|) is broken.
Date: 2018-03-03 15:43:26
Message-ID: 31399.1520091806@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Emre Hasegeli <emre(at)hasegeli(dot)com> writes:
>> Possibly this objection is pointless, because I'm not at all sure that
>> the existing code is careful about how it uses FPeq/FPzero; perhaps
>> we're applying EPSILON to all manner of numbers that don't have units
>> of the coordinate space. But this won't help make it better.

> The existing code was probably paying attention to this particular
> one, but it fails to apply EPSILON meaningfully to many other places.
> For example lseg_parallel() and lseg_perp() applies it 2 times to the
> same input. First point_sl() compares x coordinates with FPeq(), and
> then the returned slopes are compared again with FPeq().

Yeah, comparing a slope to EPSILON sure feels wrong :-(

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2018-03-03 16:06:06 Re: Online enabling of checksums
Previous Message Emre Hasegeli 2018-03-03 15:39:26 Re: line_perp() (?-|) is broken.