Re: Proposal: Trigonometric functions in degrees

Поиск
Список
Период
Сортировка
От Dean Rasheed
Тема Re: Proposal: Trigonometric functions in degrees
Дата
Msg-id CAEZATCV+6r0B1KG9KBFDY7K-9OyeAd5=UfwvR0YhGJgRJgWSOw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Proposal: Trigonometric functions in degrees  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Ответы Re: Proposal: Trigonometric functions in degrees
Список pgsql-hackers
On 27 October 2015 at 08:24, Dean Rasheed <dean.a.rasheed@gmail.com> wrote:
> I think it's still feasible to have sind(30) = 0.5 exactly and keep
> monotonicity....
>

Here's a patch along those lines. It turned out to be fairly
straightforward. It's still basically a thin wrapper on top of the
math library trig functions, with a bit of careful scaling to ensure
that curves join together to form continuous functions that are
monotonic in the expected regions and return exact values in all the
special cases 0,30,45,60,90,...

I also modified some of the CHECKFLOATVAL() checks which didn't look
right to me, unless there's some odd platform-specific behaviour that
I'm not aware of, functions like sin and asin should never return
infinity.

Regards,
Dean

Вложения

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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: September 2015 Commitfest
Следующее
От: Marko Tiikkaja
Дата:
Сообщение: Re: September 2015 Commitfest