From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dean Rasheed <dean.a.rasheed@gmail.com>
Cc: Emre Hasegeli <emre@hasegeli.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Subject: Re: Proposal: Trigonometric functions in degrees
Date: Mon, 26 Oct 2015 10:18:32 -0400
Message-ID: <26314.1445869112@sss.pgh.pa.us> (raw)
In-Reply-To: <CAEZATCWT1JVX-XeT8ghFNn84DytZ-Rw+8dZ3=u1AftM9ZerXCw@mail.gmail.com>
References: <CAEZATCXxdzxb2Mvi0-Xvp43tfvw-bUi703HdAJuLUd7dt5-ZgQ@mail.gmail.com>
<CAE2gYzyXyeBDA_nAVNAqmqUx_ouY1QVEim8gQrf4m=ict4wt1A@mail.gmail.com>
<CAEZATCWT1JVX-XeT8ghFNn84DytZ-Rw+8dZ3=u1AftM9ZerXCw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
Dean Rasheed <dean.a.rasheed@gmail.com> writes:
> On 25 October 2015 at 09:16, Emre Hasegeli <emre@hasegeli.com> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, dean.a.rasheed@gmail.com, emre@hasegeli.com
Subject: Re: Proposal: Trigonometric functions in degrees
In-Reply-To: <26314.1445869112@sss.pgh.pa.us>
References: <CAEZATCXxdzxb2Mvi0-Xvp43tfvw-bUi703HdAJuLUd7dt5-ZgQ@mail.gmail.com> <CAE2gYzyXyeBDA_nAVNAqmqUx_ouY1QVEim8gQrf4m=ict4wt1A@mail.gmail.com> <CAEZATCWT1JVX-XeT8ghFNn84DytZ-Rw+8dZ3=u1AftM9ZerXCw@mail.gmail.com> <26314.1445869112@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox