Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aPv5p-0000eU-QU for pgsql-hackers@arkaria.postgresql.org; Sun, 31 Jan 2016 16:43:17 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aPv5o-0008PC-W7 for pgsql-hackers@arkaria.postgresql.org; Sun, 31 Jan 2016 16:43:17 +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) (envelope-from ) id 1aPv4U-0006ug-SS for pgsql-hackers@postgresql.org; Sun, 31 Jan 2016 16:41:54 +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) (envelope-from ) id 1aPv4R-0007za-J5 for pgsql-hackers@postgresql.org; Sun, 31 Jan 2016 16:41:54 +0000 Received: from pro.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u0VGfcuu028992; Sun, 31 Jan 2016 11:41:39 -0500 From: Tom Lane To: Piotr Stefaniak cc: Noah Misch , Dean Rasheed , Michael Paquier , Peter Eisentraut , PostgreSQL Hackers Subject: Re: Proposal: Trigonometric functions in degrees In-reply-to: References: <31706.1448892680@sss.pgh.pa.us> <21072.1453513223@sss.pgh.pa.us> <28880.1453568920@sss.pgh.pa.us> <20160123201625.GA3691823@tornado.leadboat.com> Comments: In-reply-to Piotr Stefaniak message dated "Sun, 31 Jan 2016 13:01:43 +0100" Date: Sun, 31 Jan 2016 17:41:38 +0100 Message-ID: <67665.1454258498@sss.pgh.pa.us> X-Pg-Spam-Score: -2.5 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Piotr Stefaniak writes: > These changes from 65abaab547a5758b0d6d92df4af1663bb47d545f > - result = sign * cosd_q1(arg1) / sind_q1(arg1); > + result = sign * ((cosd_q1(arg1) / sind_q1(arg1)) / cot_45); > and > - result = sign * sind_q1(arg1) / cosd_q1(arg1); > + result = sign * ((sind_q1(arg1) / cosd_q1(arg1)) / tan_45); > both introduce division by zero, don't they? Huh? cot_45 and tan_45 are fixed values that should be very close to 1. Or were you complaining that the potential div by 0 existed beforehand? It's possible that we should check for sind_q1(arg1) or cosd_q1(arg1) being zero before we try the divide, and substitute get_float8_infinity() instead. But the regression tests exercise this case, and none of the buildfarm members complained, so I'm a bit disinclined to add code for that purpose. If anyone does report regression test failure here, we can revisit the issue then. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers