Re: pgsql: Ensure that numeric.c compiles with other NBASE values.

2023-02-03 Thread Dean Rasheed
On Fri, 3 Feb 2023 at 01:18, Tom Lane wrote: > > Dean Rasheed writes: > > > 1). It doesn't work if log10val2 < 0, because then m < 0, and it > > doesn't multiply by the remainder. And it then throws an overflow > > error, because result.dscale comes out wrong when m < 0. > > I'm not quite sure

Re: pgsql: Ensure that numeric.c compiles with other NBASE values.

2023-02-02 Thread Tom Lane
Dean Rasheed writes: > However, looking more closely, I think this function is more or less > completely broken: > 1). It doesn't work if log10val2 < 0, because then m < 0, and it > doesn't multiply by the remainder. And it then throws an overflow > error, because result.dscale comes out wrong

Re: pgsql: Ensure that numeric.c compiles with other NBASE values.

2023-02-02 Thread Dean Rasheed
On Thu, 2 Feb 2023 at 15:15, Tom Lane wrote: > > Looking at this diff made me wonder why the static pow10[] array > isn't marked "const"? > Good point. However, looking more closely, I think this function is more or less completely broken: 1). It doesn't work if log10val2 < 0, because then m <

Re: pgsql: Ensure that numeric.c compiles with other NBASE values.

2023-02-02 Thread Tom Lane
Dean Rasheed writes: > Ensure that numeric.c compiles with other NBASE values. Looking at this diff made me wonder why the static pow10[] array isn't marked "const"? regards, tom lane

pgsql: Ensure that numeric.c compiles with other NBASE values.

2023-02-02 Thread Dean Rasheed
Ensure that numeric.c compiles with other NBASE values. As noted in the comments, support for different NBASE values is really only of historical interest, but as long as we're keeping it, we might as well make sure that it compiles. Joel Jacobson Discussion: