bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] SEQ BUG


From: Jim Meyering
Subject: Re: [PATCH] SEQ BUG
Date: Fri, 22 Jun 2007 21:32:09 +0200

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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]