Summary
numfmt accepts numbers in scientific notation (1e9, 5e-3, -71e-9, ...) and converts them, while GNU numfmt rejects the e-suffix entirely as invalid suffix in input.
Found by fuzz_numfmt.
Reproduction
$ /usr/bin/numfmt -- 1e9
numfmt: invalid suffix in input: '1e9'
$ echo $?
2
$ target/debug/numfmt -- 1e9
1000000000
$ echo $?
0
Other examples:
| Input |
uutils stdout |
GNU |
1e-9 |
1 |
invalid suffix |
5e-3 |
1 |
invalid suffix |
1e2 |
100 |
invalid suffix |
-71e-9 |
-1 |
invalid suffix |
Note also that for sub-unit values like 5e-3 (= 0.005) uutils outputs 1, which does not match a plain truncation or round-to-nearest either.
Summary
numfmtaccepts numbers in scientific notation (1e9,5e-3,-71e-9, ...) and converts them, while GNUnumfmtrejects thee-suffix entirely asinvalid suffix in input.Found by
fuzz_numfmt.Reproduction
Other examples:
1e-915e-311e2100-71e-9-1Note also that for sub-unit values like
5e-3(= 0.005) uutils outputs1, which does not match a plain truncation or round-to-nearest either.