pgsql: Add trigonometric functions that work in degrees.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Add trigonometric functions that work in degrees.
Date: 2016-01-22 20:46:29
Message-ID: E1aMibF-0007DJ-Px@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Add trigonometric functions that work in degrees.

The implementations go to some lengths to deliver exact results for values
where an exact result can be expected, such as sind(30) = 0.5 exactly.

Dean Rasheed, reviewed by Michael Paquier

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/e1bd684a34c11139a1bf4e5200c3bbe59a0fbfad

Modified Files
--------------
doc/src/sgml/func.sgml | 72 +++-
src/backend/utils/adt/float.c | 437 +++++++++++++++++++-
src/include/catalog/catversion.h | 2 +-
src/include/catalog/pg_proc.h | 18 +
src/include/utils/builtins.h | 8 +
.../expected/float8-exp-three-digits-win32.out | 77 ++++
src/test/regress/expected/float8-small-is-zero.out | 77 ++++
.../regress/expected/float8-small-is-zero_1.out | 77 ++++
src/test/regress/expected/float8.out | 77 ++++
src/test/regress/sql/float8.sql | 24 ++
10 files changed, 860 insertions(+), 9 deletions(-)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2016-01-22 23:05:29 pgsql: pg_dump: Fix quoting of domain constraint names
Previous Message Tom Lane 2016-01-22 19:50:56 pgsql: Improve cross-platform consistency of Inf/NaN handling in trig f

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2016-01-22 20:50:31 Re: Proposal: Trigonometric functions in degrees
Previous Message David Rowley 2016-01-22 20:44:47 Re: Combining Aggregates