Re: Proposal: Trigonometric functions in degrees

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Proposal: Trigonometric functions in degrees
Дата
Msg-id 67665.1454258498@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Proposal: Trigonometric functions in degrees  (Piotr Stefaniak <postgres@piotr-stefaniak.me>)
Список pgsql-hackers
Piotr Stefaniak <postgres@piotr-stefaniak.me> writes:
> These changes from 65abaab547a5758b0d6d92df4af1663bb47d545f
> - result = sign * cosd_q1(arg1) / sind_q1(arg1);
> + result = sign * ((cosd_q1(arg1) / sind_q1(arg1)) / cot_45);

> and

> - result = sign * sind_q1(arg1) / cosd_q1(arg1);
> + result = sign * ((sind_q1(arg1) / cosd_q1(arg1)) / tan_45);

> both introduce division by zero, don't they?

Huh? cot_45 and tan_45 are fixed values that should be very close to 1.
Or were you complaining that the potential div by 0 existed beforehand?

It's possible that we should check for sind_q1(arg1) or cosd_q1(arg1)
being zero before we try the divide, and substitute get_float8_infinity()
instead.  But the regression tests exercise this case, and none of the
buildfarm members complained, so I'm a bit disinclined to add code for
that purpose.  If anyone does report regression test failure here, we can
revisit the issue then.
        regards, tom lane



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

Предыдущее
От: Noah Misch
Дата:
Сообщение: Re: Fwd: Core dump with nested CREATE TEMP TABLE
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Fwd: Core dump with nested CREATE TEMP TABLE