Re: Proposal: Trigonometric functions in degrees - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Proposal: Trigonometric functions in degrees
Date
Msg-id CAB7nPqQuPbqPu74QbZ9ohn207sJqbR92yZzbeuzVo74KExqQYA@mail.gmail.com
Whole thread Raw
In response to Re: Proposal: Trigonometric functions in degrees  (Piotr Stefaniak <postgres@piotr-stefaniak.me>)
Responses Re: Proposal: Trigonometric functions in degrees  (Piotr Stefaniak <postgres@piotr-stefaniak.me>)
List pgsql-hackers
On Sun, Jan 31, 2016 at 9:01 PM, Piotr Stefaniak
<postgres@piotr-stefaniak.me> wrote:
> - 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?

Per IEEE 754, division by 0 for a double results in Nan or +/-Inf, so
that's actually correct.
-- 
Michael



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: New gist vacuum.
Next
From: Alvaro Herrera
Date:
Subject: Re: PATCH: track last known XLOG segment in control file