Re: [COMMITTERS] pgsql: Add trigonometric functions that work in degrees.

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
Cc: Noah Misch <noah(at)leadboat(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [COMMITTERS] pgsql: Add trigonometric functions that work in degrees.
Date: 2016-04-21 19:47:08
Message-ID: 57192E3C.9040109@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On 04/19/2016 04:48 PM, Tom Lane wrote:
> Pushed. Peter, what results do you get from these tests on your
> problematic machine?

acosd(x),
acosd(x) IN (0,60,90,120,180) AS acosd_exact
FROM (VALUES (-1), (-0.5), (0), (0.5), (1)) AS t(x);
- x | asind | asind_exact | acosd | acosd_exact
-------+-------+-------------+-------+-------------
- -1 | -90 | t | 180 | t
- -0.5 | -30 | t | 120 | t
- 0 | 0 | t | 90 | t
- 0.5 | 30 | t | 60 | t
- 1 | 90 | t | 0 | t
+ x | asind | asind_exact | acosd | acosd_exact
+------+----------------------+-------------+-------+-------------
+ -1 | -90 | t | 180 | t
+ -0.5 | -29.9999999999999964 | f | 120 | t
+ 0 | 0 | t | 90 | t
+ 0.5 | 29.9999999999999964 | f | 60 | t
+ 1 | 90 | t | 0 | t
(5 rows)

This is the same under the default -O2 and under -O0.

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2016-04-21 20:59:41 pgsql: Remove dead code in win32.h.
Previous Message Tom Lane 2016-04-21 19:44:37 pgsql: Provide errno-translation wrappers around bind() and listen() on

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2016-04-21 19:47:50 Re: kqueue
Previous Message Andrew Dunstan 2016-04-21 19:39:05 Re: VS 2015 support in src/tools/msvc