From: | David Rowley <dgrowleyml(at)gmail(dot)com> |
---|---|
To: | Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com> |
Cc: | Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, John Naylor <john(dot)naylor(at)enterprisedb(dot)com>, PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
Subject: | Re: Improve performance of pg_strtointNN functions |
Date: | 2022-12-04 23:03:26 |
Message-ID: | CAApHDvq_=adeFd+iga05=VZCw4vgN35+kLS-WLJ9vGDCc1cObw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Sun, 4 Dec 2022 at 22:53, Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com> wrote:
> Ah, I see that you changed the overflow test, and I realise that I
> forgot to answer your question about why I wrote that as 1 - INT_MIN /
> 10 over on the other thread.
>
> The reason is that we need to detect whether tmp * base will exceed
> -INT_MIN, not INT_MAX, since we're accumulating the absolute value of
> a signed integer.
I think I'd been too focused on the simplicity of that expression and
also the base 10 part. I saw that everything worked in base 10 and
failed to give enough forward thought to other bases.
I now see that it was wrong-headed to code it the way I had it.
Thanks for pointing this out. I've just pushed a fix.
David
From | Date | Subject | |
---|---|---|---|
Next Message | Noah Misch | 2022-12-05 00:56:29 | Re: restoring user id and SecContext before logging error in ri_PlanCheck |
Previous Message | Maciek Sakrejda | 2022-12-04 22:48:43 | Re: pg_stat_bgwriter.buffers_backend is pretty meaningless (and more?) |