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

Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>

From: Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
To: tgl@sss.pgh.pa.us
Cc: andrew.dunstan@2ndquadrant.com, michael@paquier.xyz, pgsql-hackers@lists.postgresql.org, laetitia.avrot@gmail.com
Date: 2019-03-14T03:30:00Z
Lists: pgsql-hackers
At Wed, 13 Mar 2019 23:18:27 -0400, Tom Lane <tgl@sss.pgh.pa.us> wrote in <2503.1552533507@sss.pgh.pa.us>
tgl> Andrew Dunstan <andrew.dunstan@2ndquadrant.com> writes:
tgl> > Or we could possibly call the function and then turn a result of -0 into 0?
tgl> 
tgl> But -0 is the correct output if the input is -0.  So that approach
tgl> requires distinguishing -0 from 0, which is annoyingly difficult.

I think just turning both of -0 and +0 into +0 works, and, FWIW,
it is what is done in geo_ops.c (e.g. line_construct()) as a kind
of normalization and I think it is legit for geo_ops, but I don't
think so for fundamental functions like (d)asinh().

regards.

-- 
Kyotaro Horiguchi
NTT Open Source Software Center



Commits

  1. Further adjust the tests for the hyperbolic functions.

  2. Adjust the tests for the hyperbolic functions.

  3. Rethink how to test the hyperbolic functions.

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