pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add support for hyperbolic functions, as well as log10().
Date: Tue, 12 Mar 2019 19:55:14 +0000
Message-ID: <E1h3nUY-0000sM-Vf@gemulon.postgresql.org> (raw)

Add support for hyperbolic functions, as well as log10().

The SQL:2016 standard adds support for the hyperbolic functions
sinh(), cosh(), and tanh().  POSIX has long required libm to
provide those functions as well as their inverses asinh(),
acosh(), atanh().  Hence, let's just expose the libm functions
to the SQL level.  As with the trig functions, we only implement
versions for float8, not numeric.

For the moment, we'll assume that all platforms actually do have
these functions; if experience teaches otherwise, some autoconf
effort may be needed.

SQL:2016 also adds support for base-10 logarithm, but with the
function name log10(), whereas the name we've long used is log().
Add aliases named log10() for the float8 and numeric versions.

Lætitia Avrot

Discussion: https://postgr.es/m/CAB_COdguG22LO=rnxDQ2DW1uzv8aQoUzyDQNJjrR4k00XSgm5w@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f1d85aa98ee71d9662309f6f0384b2f7f8f16f02

Modified Files
--------------
doc/src/sgml/func.sgml               | 107 ++++++++++++++++++++++-
src/backend/utils/adt/float.c        | 160 ++++++++++++++++++++++++++++++++++-
src/include/catalog/catversion.h     |   2 +-
src/include/catalog/pg_proc.dat      |  25 ++++++
src/test/regress/expected/float8.out |  37 ++++++++
src/test/regress/sql/float8.sql      |   8 ++
6 files changed, 333 insertions(+), 6 deletions(-)



view thread (20+ messages)  latest in thread

Message-ID: <E1h3nUY-0000sM-Vf@gemulon.postgresql.org>
Permalink:  ../E1h3nUY-0000sM-Vf@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1h3nUY-0000sM-Vf@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Add support for hyperbolic functions, as well as log10().
  In-Reply-To: <E1h3nUY-0000sM-Vf@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox