coreutils/src
Michael Debertol 4bbbe3a3f2
sort: implement numeric string comparison (#2070)
* sort: implement numeric string comparison

This implements -n and -h using a string comparison algorithm instead
of parsing each number to a f64 and comparing those.

This should result in a moderate performance increase and eliminate loss
of precision.

* cache parsed f64 numbers

For general numeric comparisons we have to parse numbers as f64,
as this behavior is explicitly documented by GNU coreutils.
We can however cache the parsed value to speed up comparisons.

* fix leading zeroes for negative numbers

* use more appropriate name for exponent

* improvements to the parse function

* move checks into main loop and fix thousands separator condition

* remove unneeded checks

* rustfmt
2021-04-17 13:49:35 +02:00
..
bin Update the binary usage to match busybox 2021-03-10 23:52:33 +01:00
uu sort: implement numeric string comparison (#2070) 2021-04-17 13:49:35 +02:00
uucore du error output should match GNU (#1776) 2021-04-17 10:26:52 +02:00
uucore_procs Fix "panic message is not a string literal" warnings (#1915) 2021-03-26 11:09:16 +01:00