Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bEj9u-0003Hc-9H for pgsql-bugs@arkaria.postgresql.org; Sun, 19 Jun 2016 20:17:30 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bEj9s-00008B-TT for pgsql-bugs@arkaria.postgresql.org; Sun, 19 Jun 2016 20:17:28 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bEj9E-0007sh-Ti for pgsql-bugs@postgresql.org; Sun, 19 Jun 2016 20:16:48 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bEj9A-0007Ne-Sp for pgsql-bugs@postgresql.org; Sun, 19 Jun 2016 20:16:48 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u5JKGg90018082; Sun, 19 Jun 2016 16:16:42 -0400 From: Tom Lane To: emre@hasegeli.com cc: PostgreSQL Bugs Subject: Re: Line intersection point is wrong In-reply-to: References: <14750.1466353137@sss.pgh.pa.us> <9953.1466360251@sss.pgh.pa.us> Comments: In-reply-to Emre Hasegeli message dated "Sun, 19 Jun 2016 21:19:54 +0200" Date: Sun, 19 Jun 2016 16:16:42 -0400 Message-ID: <18081.1466367402@sss.pgh.pa.us> X-Pg-Spam-Score: -3.3 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Emre Hasegeli writes: >> Hmm, well, what if we change line_parallel() so that what it tests >> is whether (l1->A * l2->B - l2->A * l1->B) is zero? That seems >> simpler and more symmetric than what it does now. > I was thinking to do so. I would also check for both sides not to > overflow, but that can wait. Patch attached. Unfortunately, > the change causes too much noise on the regression tests. I don't think this is right: + x = (l1->B * l2->C - l2->B * l1->C) / (l1->A * l2->B - l2->A * l1->B); + y = (l1->A * x + l1->C) / l1->B; You haven't done anything to exclude the possibility that l1->B is zero, so you could be getting zero-divide in the y calculation. FWIW, given that you're claiming the calculation is wrong as-is, there is no particularly good reason to assume that the expected results embedded in select_views.out are correct :-(. I doubt anyone's ever tried to verify those independently. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs