[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: sort human readable suffixes
From: |
Paul Eggert |
Subject: |
Re: sort human readable suffixes |
Date: |
Mon, 31 May 2004 18:46:18 -0700 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) |
Cornelis de Gier <address@hidden> writes:
> Can you explain why strtod introduces errors?
Rounding errors. For example, IEEE double can't represent the number
10.3 exactly, so it will miscalculate a number like "10.3P".
> The -n algorithm is fairly complicated (for me). I don't see a way to
> introduce the multiplication factors.
-n scales, so for powers of 10 you just need to adjust the scaling
factor. Powers of 2 are harder; you're going to need multiple
precision arithmetic to solve that problem in general. This still
isn't so bad, but I admit it's nontrivial.
> The goal in my opinion is to be able to sort the -h output from df, du
> and ls.
But "sort" shouldn't assume the input comes from df etc; it should
work in the general case.