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.