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

Поиск
Список
Период
Сортировка
От Dean Rasheed
Тема Re: pgsql: Ensure that numeric.c compiles with other NBASE values.
Дата
Msg-id CAEZATCUZqhn1ZHvczW7TBFB75MT-aA5uZbNhNeU=atYWYb-BPw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: pgsql: Ensure that numeric.c compiles with other NBASE values.  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-committers
On Fri, 3 Feb 2023 at 01:18, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> Dean Rasheed <dean.a.rasheed@gmail.com> 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 that it's worth expending code space on the
> log10val2 < 0 case (compared to just "Assert(log10val2 >= 0").
> On the other hand, it's not much extra code, and committing it now
> might save somebody reinventing that logic in future.
>

Yeah, I thought about that, but it's hardly any code to support that
case. Also, this function is out there now (I found an example on
Stack Overflow of someone using it), so we have no control over how
people will use it in their own C code, and so I think it's worth
making it robust across the range of possible inputs.

Regards,
Dean



В списке pgsql-committers по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: pgsql: ci: Use windows VMs instead of windows containers
Следующее
От: Peter Eisentraut
Дата:
Сообщение: pgsql: doc: Fix XML formatting that psql cannot handle