Re: Numeric x^y for negative x - Mailing list pgsql-hackers

From Dean Rasheed
Subject Re: Numeric x^y for negative x
Date
Msg-id CAEZATCWAiXp7ocU3AMV6Pyvgv3O8x4-UBY+d=w+pziXXegdyOA@mail.gmail.com
Whole thread Raw
In response to Re: Numeric x^y for negative x  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Responses Re: Numeric x^y for negative x  (Zhihong Yu <zyu@yugabyte.com>)
Re: Numeric x^y for negative x  (Yugo NAGATA <nagata@sraoss.co.jp>)
List pgsql-hackers
On Thu, 1 Jul 2021 at 14:17, Dean Rasheed <dean.a.rasheed@gmail.com> wrote:
>
> On Tue, 29 Jun 2021 at 12:08, Dean Rasheed <dean.a.rasheed@gmail.com> wrote:
> >
> > Numeric x^y is supported for x < 0 if y is an integer, but this
> > currently fails if y is outside the range of an int32
>
> I've been doing some more testing of this, and I spotted another
> problem with numeric_power().
>
> [loss of precision and overflow errors]
>
> I think we should attempt to avoid all such overflow errors,
> that are actually underflows, and return zero instead.
>

Finally getting back to this ... attached is an updated patch that now
includes a fix for the loss-of-precision bug and the overflow errors.
I don't think it's really worth trying to split these up, since
they're all somewhat interrelated.

Regards,
Dean

Attachment

pgsql-hackers by date:

Previous
From: Ranier Vilela
Date:
Subject: re: Why ALTER SUBSCRIPTION ... SET (slot_name='none') requires subscription disabled?
Next
From: David Christensen
Date:
Subject: Re: [PATCH] expand the units that pg_size_pretty supports on output