Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1asVrN-0002VN-AV for pgsql-hackers@arkaria.postgresql.org; Tue, 19 Apr 2016 13:38:33 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1asVrM-00008M-O7 for pgsql-hackers@arkaria.postgresql.org; Tue, 19 Apr 2016 13:38:32 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1asVrL-00006D-PG for pgsql-hackers@postgresql.org; Tue, 19 Apr 2016 13:38:31 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1asVrI-0000vK-Pt for pgsql-hackers@postgresql.org; Tue, 19 Apr 2016 13:38:30 +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 u3JDcKJn018242; Tue, 19 Apr 2016 09:38:20 -0400 From: Tom Lane To: Dean Rasheed cc: Noah Misch , Michael Paquier , Peter Eisentraut , Robert Haas , "pgsql-hackers@postgresql.org" Subject: Re: [COMMITTERS] pgsql: Add trigonometric functions that work in degrees. In-reply-to: References: <570311F1.6020902@gmx.net> <31479.1460152130@sss.pgh.pa.us> <5714552B.5030001@gmx.net> <12238.1460985466@sss.pgh.pa.us> <20160419021144.GA1984253@tornado.leadboat.com> <20830.1461032579@sss.pgh.pa.us> <20160419024950.GB1983345@tornado.leadboat.com> <32425.1461038215@sss.pgh.pa.us> <20160419041631.GC1983345@tornado.leadboat.com> Comments: In-reply-to Dean Rasheed message dated "Tue, 19 Apr 2016 09:03:41 +0100" Date: Tue, 19 Apr 2016 09:38:20 -0400 Message-ID: <18241.1461073100@sss.pgh.pa.us> X-Pg-Spam-Score: -2.9 (--) 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 Dean Rasheed writes: > On 19 April 2016 at 05:16, Noah Misch wrote: >> On Mon, Apr 18, 2016 at 11:56:55PM -0400, Tom Lane wrote: >>> Hm? The expected answer is exact (30, 45, or whatever) in each case. >>> If we get some residual low-order digits then it's a failure, so we don't >>> need to worry about whether it's the same failure everywhere. >> Does something forbid snprintf implementations from printing '45'::float8 as >> 45.0000000000000001 under extra_float_digits=3? > I'm not sure it's really worth having the test output something like > 45.0000000000000001 since that extra detail doesn't really seem > particularly useful beyond the fact that the result wasn't exactly 45. > Also you'd have to be careful how you modified the test, since it's > possible that 45.0000000000000001 might be printed as '45' even under > extra_float_digits=3 and so there'd be a risk of the test passing when > it ought to fail, unless you also printed something else out to > indicate exactness. Yeah, what I was thinking of printing is something like asind(x), asind(x) IN (-90,-30,0,30,90) AS asind_exact, ... with extra_float_digits=3. The point of this is not necessarily to give any extra information, though it might, but for failures to be more easily interpretable. If I'd forgotten how the test worked just a few months after committing it, how likely is it that some random user faced with a similar failure would understand what they were seeing? Also, though I agree that it might not help much to know whether the output is 45.0000000000000001 or 44.9999999999999999, our thoughts would be trending in quite a different direction if it turns out that the output is radically wrong, or even a NaN. The existing test cannot exclude that possibility. 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