bug-coreutils
[Top][All Lists]
Advanced

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

Re: [PATCH] SEQ BUG


From: Paul Eggert
Subject: Re: [PATCH] SEQ BUG
Date: Tue, 19 Jun 2007 16:48:06 -0700
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)

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.

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?




reply via email to

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