Re: Proposal: Trigonometric functions in degrees

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Proposal: Trigonometric functions in degrees
Дата
Msg-id 26314.1445869112@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Proposal: Trigonometric functions in degrees  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Ответы Re: Proposal: Trigonometric functions in degrees  (Simon Riggs <simon@2ndQuadrant.com>)
Re: Proposal: Trigonometric functions in degrees  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Список pgsql-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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Masahiko Sawada
Дата:
Сообщение: Re: Freezing without cleanup lock
Следующее
От: Thom Brown
Дата:
Сообщение: Re: Patch (2): Implement failover on libpq connect level.