Re: Comparing two double values method

Поиск
Список
Период
Сортировка
От Matthias van de Meent
Тема Re: Comparing two double values method
Дата
Msg-id CAEze2Wh6TTLxwHJd2Z_jTUuJcJOSw6YM7U-=5=81tMqtTRkL_w@mail.gmail.com
обсуждение исходный текст
Ответ на Comparing two double values method  (Bowen Shi <zxwsbg12138@gmail.com>)
Список pgsql-hackers
On Tue, 10 Oct 2023 at 12:33, Bowen Shi <zxwsbg12138@gmail.com> wrote:
>
> Dears,
>
> I noticed that in the `check_GUC_init` function, there is a direct
> comparison using the != operator for two double values, which seems
> problematic.

I don't think I understand the problem. The code checks that the
dynamic initialization values are equal to the current value of the
GUC, or 0. Why would a "margin for error" of 1e-6 be of any use?
Why was the margin of 1e-6 chosen instead of one based on the exponent
of the GUC's current value (if any)?

In my view, this would break the code, not fix it, as it would
decrease the cases where we detect broken GUC registrations.

Kind regards,

Matthias van de Meent
Neon (https://neon.tech)



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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: pg_resetwal: Corrections around -c option
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Comparing two double values method