printf decimal integer formatting: shave off one division
commit3f9d4224d8db7868b6c2f526746d597785d30c61
authorRich Felker <dalias@aerifal.cx>
Mon, 6 May 2024 21:13:23 +0000 (6 17:13 -0400)
committerRich Felker <dalias@aerifal.cx>
Mon, 6 May 2024 21:13:23 +0000 (6 17:13 -0400)
tree29e628c78af5507e3200b06f0153162fc51aa926
parenta23cf8f9c5ab8ff1e1742a68b352e58b9febbe4a
printf decimal integer formatting: shave off one division

once the remaining value is less than 10, the modulo operation to
produce the final digit and division to prepare for next loop
iteration can be dropped. this may be a meaningful performance
distinction when formatting low-magnitude numbers in bulk, and should
never hurt.

based on patch by Viktor Reznov.
src/stdio/vfprintf.c