Re: [PATCH] Normalize numeric/bigint scientific notation after rounding

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
Cc: Jianqiao Han <hanjianqiao(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [PATCH] Normalize numeric/bigint scientific notation after rounding
Date: 2026-11-16 15:20:34
Message-ID: 101456.1794842434@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com> writes:
> Having said that, do we still care about supporting other NBASE
> values? If NBASE == 10, the overflow case would have weight == 1 and
> digits[0] == 1, which would need to be treated differently.

There are already places that assume NBASE==10000. Still, I feel
that this is overthinking the problem. Jianqiao's solution is
obviously correct, and if you think maybe it isn't, changing the
"if" into a "while" would take care of any strange roundoff effects
in the second division.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dean Rasheed 2026-11-16 16:04:45 Re: [PATCH] Normalize numeric/bigint scientific notation after rounding
Previous Message Andres Freund 2026-11-16 15:10:44 Re: extension_control_path: ignore empty elements and deduplicate directories