Re: [PATCH v2 next] tools/nolibc: Optimise and common up the number to ascii functions

From: Thomas Weißschuh

Date: Mon Feb 16 2026 - 13:52:15 EST


On 2026-02-13 11:08:59+0000, David Laight wrote:
> On Sun, 8 Feb 2026 19:53:08 +0000
> david.laight.linux@xxxxxxxxx wrote:
>
> > From: David Laight <david.laight.linux@xxxxxxxxx>
> >
> > Implement u[64]to[ah]_r() using a common function that uses multiply
> > by reciprocal to generate the least significant digit first and then
> > reverses the string.
>
> Self-nak on this version :-(
>
> The division code can end up generating a negative remainder for
> very large values (probably only ones over 1<<63).

Ok. Maybe some tests for these edgecases are in order, too.
Do you want to add them?


Thomas