Subject: bug#72159: Numeric sorting does not work with 100.000 values

From: Martin MOKREJŠ <[email-masked]>
Date: Wed, 17 Jul 2024 11:28:59 +0200

Hi,
   I think I found a bug in sort from coreutils-9.5 on Gentoo Linux:

$ LANG=C sort -k 1 -k 3,3n -r somefile.tsv | head
LH00211:37:222VFLLT1:1:2270:9996:7938:TACGTCACG	MN908947.3	97.333	150	4	0	1	150	22850	22999	5.82e-46	171
LH00211:37:222VFLLT1:1:2270:9996:7938:TACGTCACG	MN908947.3	96.667	150	5	0	1	150	23133	22984	2.53e-45	169
LH00211:37:222VFLLT1:1:2270:9996:23383:CGGGTCCTC	MN908947.3	99.333	150	1	0	1	150	22844	22695	7.14e-48	178
LH00211:37:222VFLLT1:1:2270:9996:23383:CGGGTCCTC	MN908947.3	99.286	140	1	0	11	150	22568	22707	2.47e-44	166
LH00211:37:222VFLLT1:1:2270:9996:22101:GAAGGATTC	MN908947.3	98.667	150	2	0	1	150	22850	22999	3.10e-47	176
LH00211:37:222VFLLT1:1:2270:9996:22101:GAAGGATTC	MN908947.3	97.333	150	4	0	1	150	23133	22984	5.82e-46	171
LH00211:37:222VFLLT1:1:2270:9996:21012:CGTGACGCA	MN908947.3	98.000	150	3	0	1	150	23133	22984	1.34e-46	173
LH00211:37:222VFLLT1:1:2270:9996:21012:CGTGACGCA	MN908947.3	100.000	150	0	0	1	150	22850	22999	1.65e-48	180
LH00211:37:222VFLLT1:1:2270:9987:8915:CACCGATGT	MN908947.3	98.571	140	2	0	11	150	22568	22707	1.07e-43	164
LH00211:37:222VFLLT1:1:2270:9987:8915:CACCGATGT	MN908947.3	97.333	150	4	0	1	150	22844	22695	5.82e-46	171
$

The line 8 with value 100.000 should appear one line earlier, on line 7 (the value 100.000 should precede 98.000). I want to sort by first column and then numerically the float values in column 3, highest to lowest. It works for float values below 100.

Thank you,
Martin