Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Zqid3-0006FZ-SB for pgsql-hackers@arkaria.postgresql.org; Mon, 26 Oct 2015 14:20:05 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1Zqid3-0003Pb-EL for pgsql-hackers@arkaria.postgresql.org; Mon, 26 Oct 2015 14:20:05 +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) (envelope-from ) id 1Zqibj-0001wA-Nf for pgsql-hackers@postgresql.org; Mon, 26 Oct 2015 14:18:43 +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) (envelope-from ) id 1Zqibc-0003O4-PP for pgsql-hackers@postgresql.org; Mon, 26 Oct 2015 14:18:42 +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 t9QEIWF2026315; Mon, 26 Oct 2015 10:18:32 -0400 From: Tom Lane To: Dean Rasheed cc: Emre Hasegeli , PostgreSQL Hackers Subject: Re: Proposal: Trigonometric functions in degrees In-reply-to: References: Comments: In-reply-to Dean Rasheed message dated "Mon, 26 Oct 2015 12:42:53 -0000" Date: Mon, 26 Oct 2015 10:18:32 -0400 Message-ID: <26314.1445869112@sss.pgh.pa.us> X-Pg-Spam-Score: -1.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 25 October 2015 at 09:16, Emre Hasegeli wrote: >> I would prefer gradian over degree. > I think gradians are generally less commonly used than degrees and > radians, so I'm less inclined to include them. I agree. gradians are not often used at all, AFAICT. > Having degree-based functions would make it trivial to implement > user-defined gradian-based functions, just by multiplying or dividing > by 0.9, and they would return exact results in the smaller number of > cases where gradian results are exactly representable. ... but having said that, your argument here is faulty, because 0.9 in itself is not exactly representable in binary. You'd be relying on roundoff happening in the right direction to get exact answers from such calculations, for just the same reasons that sind() can't be just "sin(x * scalefactor)" if you want exact-where-possible results. 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