Paul Eggert <address@hidden> wrote:
> PƔdraig Brady <address@hidden> writes:
...
>> Aren't you susceptible to whatever rounding
>> printf does internally?
>
> Yes, that's quite true. One can easily construct examples where the
> revised "seq" is mathematically incorrect, due to this problem.
> For example, on x86:
>
> $ seq -f %.20g 0 0.1 1.3
> 0
> 0.1
> 0.2
> 0.30000000000000000001
> 0.40000000000000000001
> 0.5
> 0.60000000000000000002
> 0.69999999999999999999
> 0.80000000000000000001
> 0.90000000000000000003
> 1
> 1.1
> 1.2
I was just looking at a similar example:
$ ./seq --format=%.21g .000002 .000001 .000003
2.00000000000000000007e-06
Admittedly contrived, and not really an objection.