bug-coreutils
[Top][All Lists]
Advanced

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

[PATCH] SEQ BUG


From: Pádraig Brady
Subject: [PATCH] SEQ BUG
Date: Fri, 08 Jun 2007 10:10:45 +0100
User-agent: Thunderbird 1.5.0.8 (X11/20061116)

John Cowan wrote:
> Pádraig Brady scripsit:
> 
>> The issue and work around are documented in the info page,
>> but why don't we do the suggestion automatically in code
>> (using the precision that is automatically worked out already)?
> 
> That implies using either a fixed-point or a decimal-based floating-point
> package.  GNU gmp seems to be the obvious candidate.

Yes you could use gmp, but for normal uses of `seq`
you could just use appropriate comparisons?
How about the following patch, and we can also
remove the workaround info from the docs.

Pádraig.

--- seq.orig.c  2007-06-08 07:50:24.000000000 +0000
+++ seq.c       2007-06-08 09:05:23.000000000 +0000
@@ -357,6 +357,10 @@
        }
     }

+  /* perhaps can use nextafterl? */
+  #define PRECISION 1.0E-15
+  last.value += step.value + (step.value>0?-PRECISION:PRECISION);
+
   if (format_str != NULL && equal_width)
     {
       error (0, 0, _("\





reply via email to

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