Summary
When the combined width/precision of --format=%N.Mf can't faithfully represent a very large integer (roughly above 10¹⁸), GNU numfmt rejects the input with a clear error. uutils skips that check and silently prints the value with precision loss.
Found by fuzz_numfmt.
Reproduction
$ LC_ALL=C /usr/bin/numfmt --format=%5.1f 1000000000000000000
numfmt: value/precision too large to be printed: '1e+18/1' (consider using --to)
(rc=2)
$ LC_ALL=C target/debug/numfmt --format=%5.1f 1000000000000000000
1000000000000000000.0
(rc=0)
Another reproducer (found directly by the fuzzer):
$ LC_ALL=C /usr/bin/numfmt --round=from-zero --padding=-12 --format=%\'5.1f \
--debug --header=5 --delimiter=: 4544384872967057418 419
numfmt: value/precision too large to be printed: '4.54438e+18/1' (consider using --to)
(rc=2)
$ LC_ALL=C target/debug/numfmt --round=from-zero --padding=-12 --format=%\'5.1f \
--debug --header=5 --delimiter=: 4544384872967057418 419
4544384872967057418.0
419.0
(rc=0)
Values at or below ~10¹⁷ format identically on both.
Summary
When the combined width/precision of
--format=%N.Mfcan't faithfully represent a very large integer (roughly above 10¹⁸), GNUnumfmtrejects the input with a clear error. uutils skips that check and silently prints the value with precision loss.Found by
fuzz_numfmt.Reproduction
Another reproducer (found directly by the fuzzer):
Values at or below ~10¹⁷ format identically on both.