Re: exp() versus the POSIX standard

2020-06-13 Thread Tom Lane
Emre Hasegeli writes: >> No, no kind of GUC switch is needed. Just drop underflow/overflow checks. >> You'll get 0 or Infinity in expected places, and infinities are okay since >> 2007. > This is out of scope of this thread. Yeah, that. At the moment I'm just interested in making the float an

Re: exp() versus the POSIX standard

2020-06-12 Thread Emre Hasegeli
> No, no kind of GUC switch is needed. Just drop underflow/overflow checks. > You'll get 0 or Infinity in expected places, and infinities are okay since > 2007. This is out of scope of this thread. I am not sure opening it to discussion on another thread would yield any result. Experienced dev

Re: exp() versus the POSIX standard

2020-06-12 Thread Emre Hasegeli
> Does anyone disagree that that's a bug? Should we back-patch > a fix, or just change it in HEAD? Given the lack of user > complaints, I lean a bit towards the latter, but am not sure. The other functions and operators pay attention to not give an error when the input is Inf or 0. exp() and p

Re: exp() versus the POSIX standard

2020-06-11 Thread Komяpa
Hi, On Fri, Jun 12, 2020 at 4:25 AM Tom Lane wrote: > =?UTF-8?Q?Darafei_=22Kom=D1=8Fpa=22_Praliaskouski?= > writes: > > I've had the same issue with multiplying two tiny numbers. Select > > 2e-300::float * 2e-300::float gives an underflow, and it is not a wanted > > thing. This looks like handm

Re: exp() versus the POSIX standard

2020-06-11 Thread Tom Lane
=?UTF-8?Q?Darafei_=22Kom=D1=8Fpa=22_Praliaskouski?= writes: > I've had the same issue with multiplying two tiny numbers. Select > 2e-300::float * 2e-300::float gives an underflow, and it is not a wanted > thing. This looks like handmade implementation of IEEE754's underflow > exception that should

Re: exp() versus the POSIX standard

2020-06-11 Thread Komяpa
пт, 12 чэр 2020, 02:57 карыстальнік Tom Lane напісаў: > I wrote: > > The POSIX standard says this about the exp(3) function: > > If x is -Inf, +0 shall be returned. > > At least on my Linux box, our version does no such thing: > > regression=# select exp('-inf'::float8); > > ERROR: value o

Re: exp() versus the POSIX standard

2020-06-11 Thread Tom Lane
I wrote: > The POSIX standard says this about the exp(3) function: > If x is -Inf, +0 shall be returned. > At least on my Linux box, our version does no such thing: > regression=# select exp('-inf'::float8); > ERROR: value out of range: underflow Now that I look, power() has similar issues:

exp() versus the POSIX standard

2020-06-11 Thread Tom Lane
The POSIX standard says this about the exp(3) function: If x is -Inf, +0 shall be returned. At least on my Linux box, our version does no such thing: regression=# select exp('-inf'::float8); ERROR: value out of range: underflow Does anyone disagree that that's a bug? Should we back-pa