Re: [Patch] Log10 and hyperbolic functions for SQL:2016 compliance

Lætitia Avrot <laetitia.avrot@gmail.com>

From: Lætitia Avrot <laetitia.avrot@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Andrew Gierth <andrew@tao11.riddles.org.uk>, Alvaro Herrera <alvherre@2ndquadrant.com>, Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2019-02-11T17:44:41Z
Lists: pgsql-hackers

Attachments

Hi Andrew and Tom,

I considered that option before writing my patch but I refrained for 2
reasons:

- There is no consensus about how to name these functions. The standard
8000-2 goes with arsinh, arcosh and artanh,
  but you will find easily arcsinh, arccosh and arctanh or even argsinh,
argcosh and argtanh. In IT, the names asinh,
  acosh and atanh are commonly used too. We might implement them with
asinh, acosh and atanh names and add
  aliases if SQL standard decide to add it under other names though.
- If we go with inverse hyperbolic functions, I guess we could add other
hyperbolic functions as hyperbolic cosecant,
  secant and cotangent too. Then it adds the inverse hyperbolic functions
of these three functions. These six functions
  are not described in math.h library. I guess it's because these functions
are quite simple to deduce from the others.

So, as you're asking that too, maybe my reasons weren't good enough. You'll
find enclosed a new version of the patch
with asinh, acosh and atanh (v5).

Then I tried for several days to implement the 6 last hyperbolic functions,
but I wasn't satisfied with the result, so I just dropped it.

Cheers,

Lætitia

Le dim. 3 févr. 2019 à 16:12, Tom Lane <tgl@sss.pgh.pa.us> a écrit :

> Andrew Gierth <andrew@tao11.riddles.org.uk> writes:
> > The spec doesn't require the inverse functions (asinh, acosh, atanh),
> > but surely there is no principled reason to omit them?
>
> +1 --- AFAICS, the C library has offered all six since C89.
>
>                         regards, tom lane
>


-- 
*Think! Do you really need to print this email ? *
*There is no Planet B.*

Commits

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