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

2019-03-18 Thread Komяpa
I really appreciate the addition of tanh into core postgres. If someone doubts it is useful: it is used as a part of math in geographical calculations. Say you have your cars in planar Mercator projection and want to move them "1 second forward by this heading with this speed". sin/cos and the

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

2019-03-13 Thread Lætitia Avrot
Thanks, Tom ! Thank you everyone for your help and patience. Cheers, Lætitia Le mar. 12 mars 2019 à 20:57, Tom Lane a écrit : > =?UTF-8?Q?L=C3=A6titia_Avrot?= writes: > > So, as you're asking that too, maybe my reasons weren't good enough. > You'll > > find enclosed a new version of the

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

2019-03-12 Thread Tom Lane
=?UTF-8?Q?L=C3=A6titia_Avrot?= writes: > 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). Pushed with some minor adjustments (mainly cleanup of the error handling). > Then I tried for

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

2019-03-11 Thread Tom Lane
Dean Rasheed writes: > +1 for including the inverse functions. However, it looks to me like > the inverse functions are C99-specific, so they might not be available > on all supported platforms. If they're not, we may need to provide our > own implementations. FWIW, I'm pretty sure they're

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

2019-03-11 Thread Dean Rasheed
On Sun, 3 Feb 2019 at 15:12, Tom Lane wrote: > > Andrew Gierth 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. > +1 for including the

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

2019-02-11 Thread Tom Lane
Gavin Flower writes: > On 12/02/2019 06:44, Lætitia Avrot wrote: >> 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

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

2019-02-11 Thread Gavin Flower
On 12/02/2019 06:44, Lætitia Avrot wrote: 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

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

2019-02-11 Thread Lætitia Avrot
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

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

2019-02-03 Thread Tom Lane
Andrew Gierth 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

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

2019-02-02 Thread Andrew Gierth
> "Lætitia" == Lætitia Avrot writes: [snip patch] The spec doesn't require the inverse functions (asinh, acosh, atanh), but surely there is no principled reason to omit them? -- Andrew (irc:RhodiumToad)

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

2019-02-02 Thread Lætitia Avrot
Hi Alvaro, Thank you so much for taking the time to review the patch and for taking the time again to sort things out with me this evening. > I see that in dtanh() you set errno to 0 before calling tanh(), but 1) > you don't check for it afterwards (seems like you should be checking for >

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

2019-02-01 Thread Alvaro Herrera
On 2019-Jan-31, Lætitia Avrot wrote: > Hi, > > Thanks to Emil Iggland's kind review, I added precision on documentation > for hyperbolic functions. Hello I see that in dtanh() you set errno to 0 before calling tanh(), but 1) you don't check for it afterwards (seems like you should be checking

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

2019-01-31 Thread Lætitia Avrot
Hi, Thanks to Emil Iggland's kind review, I added precision on documentation for hyperbolic functions. I added the patch to the next commitfest. Cheers, Lætitia Le dim. 27 janv. 2019 à 20:39, Lætitia Avrot a écrit : > Hi, > > Thanks for your time and advice, Tom! > > >> > [

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

2019-01-27 Thread Lætitia Avrot
Hi, Thanks for your time and advice, Tom! > > [ adding_log10_and_hyperbolic_functions_v1.patch ] > > No objection to the feature, but > > - Why are you using the float4-width library functions (coshf etc) > rather than the float8-width ones (cosh etc)? > > Well, I guess the only reason is that

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

2019-01-26 Thread Tom Lane
=?UTF-8?Q?L=C3=A6titia_Avrot?= writes: > [ adding_log10_and_hyperbolic_functions_v1.patch ] No objection to the feature, but - Why are you using the float4-width library functions (coshf etc) rather than the float8-width ones (cosh etc)? - I wonder whether these library functions exist

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

2019-01-26 Thread Lætitia Avrot
Hello hackers, In his blog post (What's new in SQL 2016)[ https://modern-sql.com/blog/2017-06/whats-new-in-sql-2016], Markus Winand explained some of the changes added to SQL:2016. I spotted that Postgres was behind other RDBMS on hyperbolic functions and log10 function. The log10 function