Incompatible trig error handling

From: John Gorman <johngorman2(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Incompatible trig error handling
Date: 2015-04-29 23:07:26
Message-ID: CALkS6B-eKw_wrd3CLKM2noS-pqCDJ=Uxznkq8oEpW3AZLBFh9g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Two of the trigonometry functions have differing error condition behavior
between Linux and OSX. The Linux behavior follows the standard set by the
other trig functions.

On Linux:

SELECT asin(2);
> ERROR: input is out of range
>

SELECT acos(2);
> ERROR: input is out of range

On OSX:

SELECT asin(2);
> asin
> ------
> NaN
> (1 row)
>

SELECT asin(2);
> asin
> ------
> NaN
> (1 row)

The attached patch brings OSX into line with the expected behaviour and the
additional regression tests verify this.

Is this worth fixing and if so what is the next step?

Best, John

Attachment Content-Type Size
trig-v1.patch application/octet-stream 1.7 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2015-04-29 23:09:40 Re: INSERT ... ON CONFLICT syntax issues
Previous Message Petr Jelinek 2015-04-29 22:58:58 Re: mogrify and indent features for jsonb