bug#8202: seq bug

2011-03-08 Thread Eric Blake
On 03/08/2011 04:03 AM, Vit Bartunek wrote: > Hi there, > > seq parametr -w (--equal-width) is not working > > Trying to execute command bellow, the parametr seems to be ignored. > seq --equal-width 1 0 99 Thanks for the report. However, I cannot reproduce it: $ seq -w 1 0 99 | head 01 01 01

bug#8202: seq bug

2011-03-08 Thread Vit Bartunek
Hi there, seq parametr -w (--equal-width) is not working Trying to execute command bellow, the parametr seems to be ignored. seq --equal-width 1 0 99 Name: coreutilsRelocations: (not relocatable) Version : 5.97 Vendor: CentOS Release

Re:Re: seq bug? LAST equals 1,000,000

2009-08-21 Thread db_23
Hi Bob, Eric Thank you for your replies. >db_23?wrote: >>?When?LAST?is?equal?to?1,000,000?(seq?1000).?I?got?the?outcome?as This is my fault. It should be 10,000,000. >>?the?following.?Numbers?after?999,999?appears?more?than?once,?but?not >>?at?fixed?times. > >Thank?you?for?the?report.??Unf

Re: seq bug? LAST equals 1,000,000

2009-08-20 Thread Bob Proulx
db_23 wrote: > When LAST is equal to 1,000,000 (seq 1000). I got the outcome as > the following. Numbers after 999,999 appears more than once, but not > at fixed times. Thank you for the report. Unfortunately seq uses floating point numbers internally. This has caused some problems in the re

Re: seq bug? LAST equals 1,000,000

2009-08-20 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to db_23 on 8/20/2009 9:06 AM: > Hi > When LAST is equal to 1,000,000 (seq 1000). I got the outcome as the > following. Numbers after 999,999 appears more than once, but not at fixed > times. 1,000,000 is not the same as 1000. W

seq bug? LAST equals 1,000,000

2009-08-20 Thread db_23
Hi When LAST is equal to 1,000,000 (seq 1000). I got the outcome as the following. Numbers after 999,999 appears more than once, but not at fixed times. - 97 98 99 1e+06 1e+06 1e+06 1e+06 1e+06 1e+06 1.1e+06 1.1e+06 1.1e+06 1.1e+06 1.1e+06 1.1

Re: seq bug -- out of bounds read (off by one)

2008-03-24 Thread Jim Meyering
Daniel Dunbar <[EMAIL PROTECTED]> wrote: > Thanks for the quick reply on the ptx bug. > > We have found another minor bug (non-crashing) in seq. An example problem > input > is: > -- > [EMAIL PROTECTED]:src$ ./seq -f %0 1 > ./seq: memory exhausted > -- > > The problem is in seq.c:213 (in 6.10 sour

seq bug -- out of bounds read (off by one)

2008-03-23 Thread Daniel Dunbar
Hi Jim, Thanks for the quick reply on the ptx bug. We have found another minor bug (non-crashing) in seq. An example problem input is: -- [EMAIL PROTECTED]:src$ ./seq -f %0 1 ./seq: memory exhausted -- The problem is in seq.c:213 (in 6.10 source), if (! strchr ("efgaEFGA", fmt[i]

Re: [PATCH] SEQ BUG

2007-06-23 Thread Jim Meyering
Paul Eggert <[EMAIL PROTECTED]> wrote: > Pádraig Brady <[EMAIL PROTECTED]> writes: > >> The attached patch handles this by >> only counting signficant digits from the operands. > > I'd rather use the idea I proposed earlier. Here's an implementation > of it, which works on all the test cases in y

Re: [PATCH] SEQ BUG

2007-06-22 Thread Paul Eggert
Pádraig Brady <[EMAIL PROTECTED]> writes: > Thank you for the explanation and fixing this up. You're welcome. And thanks for supplying such a fun problem, (though perhaps I should qualify that by saying it was more fun than what I should have been working on, which was grading my students' work.

Re: [PATCH] SEQ BUG

2007-06-22 Thread Paul Eggert
Micah Cowan <[EMAIL PROTECTED]> writes: > f making seq act as if it were counting in decimal for fractions, > instead of binary floating-point, is really something we want to > consider, then why don't we actually have seq represent fractions in > decimal, internally? Yes, that would be better.

Re: [PATCH] SEQ BUG

2007-06-22 Thread Pádraig Brady
Paul Eggert wrote: > Pádraig Brady <[EMAIL PROTECTED]> writes: > >> I haven't time to look at this now, >> but will soon. > > Thanks. > >> A couple of points came to mind. >> >> Is it OK to look at just 1 value "after" last? > > It should not be necessary to look 2 values "after" last. The pro

Re: [PATCH] SEQ BUG

2007-06-22 Thread Micah Cowan
f making seq act as if it were counting in decimal for fractions, instead of binary floating-point, is really something we want to consider, then why don't we actually have seq represent fractions in decimal, internally? Isn't that the only real way we could possibly expect seq to "do what the user

Re: [PATCH] SEQ BUG

2007-06-22 Thread Jim Meyering
Paul Eggert <[EMAIL PROTECTED]> wrote: > Pádraig Brady <[EMAIL PROTECTED]> 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.

Re: [PATCH] SEQ BUG

2007-06-22 Thread Paul Eggert
Pádraig Brady <[EMAIL PROTECTED]> writes: > I haven't time to look at this now, > but will soon. Thanks. > A couple of points came to mind. > > Is it OK to look at just 1 value "after" last? It should not be necessary to look 2 values "after" last. The problem we're trying to address is the bu

Re: [PATCH] SEQ BUG

2007-06-22 Thread Pádraig Brady
Paul Eggert wrote: > + /* If we go one past the end, but that number prints the > + same way "last" does, and prints differently from the > + previous number, then print "last". This avoids problems > + with rounding. For example, with the x86 it causes "seq > +

Re: [PATCH] SEQ BUG

2007-06-22 Thread Paul Eggert
Pádraig Brady <[EMAIL PROTECTED]> writes: > The attached patch handles this by > only counting signficant digits from the operands. I'd rather use the idea I proposed earlier. Here's an implementation of it, which works on all the test cases in your patch. In addition, it works on the wilder co

Re: [PATCH] SEQ BUG

2007-06-20 Thread Pádraig Brady
Pádraig Brady wrote: > Paul Eggert wrote: >> Pádraig Brady <[EMAIL PROTECTED]> 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.9000" outputs somet

Re: [PATCH] SEQ BUG

2007-06-20 Thread Pádraig Brady
Paul Eggert wrote: > Pádraig Brady <[EMAIL PROTECTED]> 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.9000" outputs something different from > "se

Re: [PATCH] SEQ BUG

2007-06-19 Thread Paul Eggert
Pádraig Brady <[EMAIL PROTECTED]> 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.9000" outputs something different from "seq 0.0 0.1 0.9". The former stops

Re: [PATCH] SEQ BUG

2007-06-19 Thread Pádraig Brady
Pádraig Brady wrote: > Paul Eggert wrote: >> Pádraig Brady <[EMAIL PROTECTED]> writes: >> >>> This patch makes `seq 0.1 0.1 0.9` output 0.1 to 0.9 inclusive, as expected. >> I see some problems with that patch. >> >> First, it continues to mishandle some similar cases. For example, >> 'seq 0.1 1e-

Re: [PATCH] SEQ BUG

2007-06-13 Thread Pádraig Brady
Paul Eggert wrote: > Pádraig Brady <[EMAIL PROTECTED]> writes: > >> This patch makes `seq 0.1 0.1 0.9` output 0.1 to 0.9 inclusive, as expected. > > I see some problems with that patch. > > First, it continues to mishandle some similar cases. For example, > 'seq 0.1 1e-1 0.9' outputs only 0.1 t

Re: [PATCH] SEQ BUG

2007-06-13 Thread Paul Eggert
Pádraig Brady <[EMAIL PROTECTED]> writes: > This patch makes `seq 0.1 0.1 0.9` output 0.1 to 0.9 inclusive, as expected. I see some problems with that patch. First, it continues to mishandle some similar cases. For example, 'seq 0.1 1e-1 0.9' outputs only 0.1 through 0.8, i.e. it behaves differ

[PATCH] SEQ BUG

2007-06-13 Thread Pádraig Brady
This patch makes `seq 0.1 0.1 0.9` output 0.1 to 0.9 inclusive, as expected. The documentation for the previously required workaround is removed. Note I changed the Makefile for seq to link $(SEQ_LIBM) rather than $(POW_LIB), as $(POW_LIB) was empty. Is the configure test correct for pow()? as gcc

Re: SEQ BUG

2007-06-09 Thread Jim Meyering
Paul Eggert <[EMAIL PROTECTED]> wrote: > Jim Meyering <[EMAIL PROTECTED]> writes: > >> Pádraig Brady <[EMAIL PROTECTED]> wrote: >> ... >>> Another thing I just noticed. I would expect the precision >>> of all output in the following command to be to 2 decimal places not 1: >>> $ seq 0.00 0.01 0.90

Re: SEQ BUG

2007-06-09 Thread Paul Eggert
Jim Meyering <[EMAIL PROTECTED]> writes: > Pádraig Brady <[EMAIL PROTECTED]> wrote: > ... >> Another thing I just noticed. I would expect the precision >> of all output in the following command to be to 2 decimal places not 1: >> $ seq 0.00 0.01 0.90 | grep "\.[0-9]$" >> 0.1 >> 0.2 >> 0.3 >> 0.4 >

Re: [PATCH] SEQ BUG

2007-06-08 Thread Pádraig Brady
Andreas Schwab wrote: > Pádraig Brady <[EMAIL PROTECTED]> writes: > >> 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

Re: [PATCH] SEQ BUG

2007-06-08 Thread Andreas Schwab
Pádraig Brady <[EMAIL PROTECTED]> writes: > 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.0

Re: [PATCH] SEQ BUG

2007-06-08 Thread Pádraig Brady
Pádraig Brady wrote: > 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

[PATCH] SEQ BUG

2007-06-08 Thread Pádraig Brady
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

Re: SEQ BUG

2007-06-07 Thread John Cowan
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

Re: SEQ BUG

2007-06-07 Thread Jim Meyering
Pádraig Brady <[EMAIL PROTECTED]> wrote: ... > Another thing I just noticed. I would expect the precision > of all output in the following command to be to 2 decimal places not 1: > > $ seq 0.00 0.01 0.90 | grep "\.[0-9]$" > 0.1 > 0.2 > 0.3 > 0.4 > 0.5 > 0.6 > 0.7 > 0.8 > 0.9 Well, at least with t

Re: SEQ BUG

2007-06-07 Thread Micah Cowan
Pádraig Brady wrote: > Another thing I just noticed. I would expect the precision > of all output in the following command to be to 2 decimal places not 1: > > $ seq 0.00 0.01 0.90 | grep "\.[0-9]$" > 0.1 > 0.2 > 0.3 > 0.4 > 0.5 > 0.6 > 0.7 > 0.8 > 0.9 I wouldn't. The documentation is fairly cle

Re: SEQ BUG

2007-06-07 Thread Pádraig Brady
Micah Cowan wrote: > Patrick Amstutz wrote: >> Hi, >> >> I've the following behavior with the seq function on: >> >> Linux version 2.6.18.8-0.3-default ([EMAIL PROTECTED]) (gcc version >> 4.1.220061115 (prerelease) (SUSE Linux)) #1 >> >> $ echo `seq 0.0 0.1 0.8` >> 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8

Re: SEQ BUG

2007-06-07 Thread John Cowan
Micah Cowan scripsit: > You need to use something more like: > $ echo `seq 0.0 0.1 0.91` > 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 Or better yet, use `seq 0 9` and prepend the "0." part yourself. (The Cowan twins strike again!) -- A witness cannot give evidence of his John Cowan age un

Re: SEQ BUG

2007-06-07 Thread John Cowan
Patrick Amstutz scripsit: > $ echo `seq 0.0 0.1 0.8` > 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 > $ echo `seq 0.0 0.1 0.9` > 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 Welcome to floating-point roundoff errors. The decimal constant 0.1 cannot be exactly represented as a floating-point number on modern hardware,

Re: SEQ BUG

2007-06-07 Thread Micah Cowan
Patrick Amstutz wrote: > Hi, > > I've the following behavior with the seq function on: > > Linux version 2.6.18.8-0.3-default ([EMAIL PROTECTED]) (gcc version > 4.1.220061115 (prerelease) (SUSE Linux)) #1 > > $ echo `seq 0.0 0.1 0.8` > 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 > $ echo `seq 0.0 0.1 0.9`

SEQ BUG

2007-06-07 Thread Patrick Amstutz
Hi, I've the following behavior with the seq function on: Linux version 2.6.18.8-0.3-default ([EMAIL PROTECTED]) (gcc version 4.1.220061115 (prerelease) (SUSE Linux)) #1 $ echo `seq 0.0 0.1 0.8` 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 $ echo `seq 0.0 0.1 0.9` 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 Best r