GNU bug report logs - #23214
Possible bug in sort -g

Previous Next

Package: coreutils;

Reported by: Matthijs Nescio <matthijs_1971 <at> hotmail.com>

Date: Mon, 4 Apr 2016 13:18:02 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Matthijs Nescio <matthijs_1971 <at> hotmail.com>
To: 23214 <at> debbugs.gnu.org
Subject: bug#23214: Possible bug in sort -g
Date: Mon, 4 Apr 2016 13:46:46 +0200
[Message part 1 (text/plain, inline)]
Hi,

I seem to have detected a bug in sort. Can you confirm?

~ $ 
~ $ sort --version
sort (GNU coreutils) 8.4
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Haertel and Paul Eggert.
~ $ cat test.txt | sort -g

2e-1
2e-1
2e-1
2e-1
1.0e-1
1.0e-2
1.0e-2
1.0e-3
1.0e-4
2.0e-1
2.0e-2
2.0e-2
2.0e-2
2.0e-2
3.0e-2
3.0e-2
3.0e-2
3.0e-2
3.0e-2
3.0e-2
15
2e+1
2e+1
2e+1
2e+1
115
119
150
2e+2
2e+2
2e+2
2e+2
2e+3
2e+3
2e+3
2e+3
~ $ cat test.txt
3.0e-2
1.0e-4
2.0e-2
3.0e-2
1.0e-1
2.0e-1
3.0e-2
1.0e-2
2.0e-2
3.0e-2
1.0e-2
2.0e-2
3.0e-2
1.0e-3
2.0e-2
3.0e-2
15
119
115
150
2e+1
2e-1
2e+3
2e+2
2e+1
2e-1
2e+3
2e+2
2e+1
2e-1
2e+3
2e+2
2e+1
2e-1
2e+3
2e+2

~ $  


I think this result is never what anybody would expect; 2e-1 is larger than 1.0e-1 and  1.0e-4 is smaller than 1.0e-1.

The above is running on Ubuntu 14.04. On a Cygwin installation the result is fine.

Thank you, kind regards, Matthijs.

 		 	   		  
[Message part 2 (text/html, inline)]

This bug report was last modified 9 years and 47 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.