bug-coreutils
[Top][All Lists]
Advanced

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

Re: [PATCH] SEQ BUG


From: Pádraig Brady
Subject: Re: [PATCH] SEQ BUG
Date: Wed, 20 Jun 2007 13:49:34 +0100
User-agent: Thunderbird 1.5.0.8 (X11/20061116)

Paul Eggert wrote:
> Pádraig Brady <address@hidden> writes:
> 
>> OK, how about the attached patch?
> 
> Better, but it still has problems.  For example, on my platform
> (Debian stable with GCC 4.2.0, x86) the command
> "seq 0.0 0.1 0.90000000000000000000" outputs something different from
> "seq 0.0 0.1 0.9".  The former stops at 0.8, the latter at 0.9.

You're stretching :)
I'll see if I can fix that,
but I do think it's much better that what we have currently.

> In general, if we want seq's numeric behavior to be independent of the
> format of the operand numbers, I think we have to take a different
> approach.
> 
> Here's an idea.  Use sprintf to convert the numbers to a textual
> format and back, and then use the result of _that_ comparison instead
> of the internal floating-point comparison.  For speed, do this only
> for the number "one past" the number that "seq" would ordinarily print
> now.  Also, don't bother to print this extra number if it's textually
> identical to the previously printed number.
> 
> Whaddya think?

I'll have another look.

Pádraig.




reply via email to

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