GNU bug report logs - #6020
coreutils-8.x: a simple feature enhancement, and how to do it

Previous Next

Package: coreutils;

Reported by: "Nelson H. F. Beebe" <beebe <at> math.utah.edu>

Date: Sat, 24 Apr 2010 01:31:01 UTC

Severity: normal

Fixed in version 8.6

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Paul Eggert <eggert <at> CS.UCLA.EDU>
To: "Nelson H. F. Beebe" <beebe <at> math.utah.edu>
Cc: 6020 <at> debbugs.gnu.org, Pádraig Brady <P <at> draigBrady.com>
Subject: bug#6020: coreutils-8.x: a simple feature enhancement, and how to do it
Date: Fri, 30 Apr 2010 11:57:30 -0700
"Nelson H. F. Beebe" <beebe <at> math.utah.edu> writes:

> Because using double instead of long double cripples sorting of
> numerical data by drastically reducing the number range, I would much
> rather pay a premium in run time to get the right answer, rather than
> a useless wrong answer as GNU sort currently does.

Yes, that's right.  But my note was not about that.  It was about
improving performance while not affecting behavior.  If all we have is
strtod, there's no point doing a long-double compare.

>   -g, --general-numeric-sort  compare according to general numerical
>          value in type double
>   -gg    same as before, but with type long double
>   -ggg   same as before, but with general multiple-precision floating
>          arithmetic using the gmp library

Even better, just compare the numbers as text, without converting them
to internal format.  This is already done for -n, and would be much
faster than any of the above approaches.  If done right it would be just
as accurate as gmp.  (It wouldn't be trivial, though.)




This bug report was last modified 15 years and 83 days ago.

Previous Next


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