From unknown Mon Jun 23 02:24:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13394: Misalignment for "seq -w" Resent-From: "Marcel =?UTF-8?Q?B=C3=B6hme?=" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Wed, 09 Jan 2013 10:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 13394 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 13394@debbugs.gnu.org X-Debbugs-Original-To: bug-coreutils@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.135772654211091 (code B ref -1); Wed, 09 Jan 2013 10:16:02 +0000 Received: (at submit) by debbugs.gnu.org; 9 Jan 2013 10:15:42 +0000 Received: from localhost ([127.0.0.1]:57925 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TsshB-0002sp-9l for submit@debbugs.gnu.org; Wed, 09 Jan 2013 05:15:42 -0500 Received: from eggs.gnu.org ([208.118.235.92]:43431) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tssh8-0002sa-U1 for submit@debbugs.gnu.org; Wed, 09 Jan 2013 05:15:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tssgu-0001QS-4w for submit@debbugs.gnu.org; Wed, 09 Jan 2013 05:15:24 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-101.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, USER_IN_WHITELIST autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:40769) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tssgu-0001QO-2b for submit@debbugs.gnu.org; Wed, 09 Jan 2013 05:15:24 -0500 Received: from eggs.gnu.org ([208.118.235.92]:54788) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tssgs-0001vs-U1 for bug-coreutils@gnu.org; Wed, 09 Jan 2013 05:15:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tssgq-0001PZ-VK for bug-coreutils@gnu.org; Wed, 09 Jan 2013 05:15:22 -0500 Received: from mout.web.de ([212.227.15.4]:65400) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tssgq-00018y-M2 for bug-coreutils@gnu.org; Wed, 09 Jan 2013 05:15:20 -0500 Received: from 3capp-webde-bs13.server.lan ([172.19.170.13]) by mriweb.server.lan (mriweb002) with ESMTPA (Nemesis) id 0M7XfF-1T5kMs0Xt1-00x5Ju for ; Wed, 09 Jan 2013 11:14:53 +0100 Received: from [137.132.192.186] by 3capp-webde-bs13.server.lan with HTTP; Wed Jan 09 11:14:53 CET 2013 MIME-Version: 1.0 Message-ID: From: "Marcel =?UTF-8?Q?B=C3=B6hme?=" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Date: Wed, 9 Jan 2013 11:14:53 +0100 (CET) Importance: normal Sensitivity: Normal X-Priority: 3 X-Provags-ID: V03:K0:usBDm48PpTMq45Lyz2T5CQHgxqR6m2J76k53ZUgtgrV 3iMcCSp4rvcX1NIozo/i9DbkQ+taq+M7QaeOpEgQ6I8sXDT0E9 KFOJnCy7RwOWGGPPhh+LKyMOEP2vkbW0zJxlc9fDePhEv99t4z ccvQxQLTGEJ4MjXwFAuK0iYj2MdFT+JMOpBHjeGjGIg8FtePto o/hNNhfLq+AaaN1Z38px4mmORFW4V9SQ449GzHUAvvEEZda82e uRSttEiwkpcOGUWk0cn7o1oc5w9pv8mT3GWQurnPB0rRpOQT3I 3dkHV14J2a4zLXoYvA5yeUcC7Tx X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -4.2 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.0 (-----) Dear all, There are the following problems with the -w parameter of the seq tool: $seq -w -1 1.0 0 -1.0 0.0 1.0 But it should print: -1.0 00.0 01.0 A similar problem is observable for: $seq -w 10 -.1 1 | head Best regards, Marcel From unknown Mon Jun 23 02:24:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13394: Misalignment for "seq -w" Resent-From: Bernhard Voelker Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Wed, 09 Jan 2013 10:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13394 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Marcel =?UTF-8?Q?B=C3=B6hme?= , =?UTF-8?Q?P=C3=A1draig?= Brady Cc: 13394@debbugs.gnu.org Received: via spool by 13394-submit@debbugs.gnu.org id=B13394.135772771912981 (code B ref 13394); Wed, 09 Jan 2013 10:36:02 +0000 Received: (at 13394) by debbugs.gnu.org; 9 Jan 2013 10:35:19 +0000 Received: from localhost ([127.0.0.1]:57946 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tst0A-0003ND-7J for submit@debbugs.gnu.org; Wed, 09 Jan 2013 05:35:19 -0500 Received: from moutng.kundenserver.de ([212.227.126.171]:51977) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tst02-0003Mv-Kd for 13394@debbugs.gnu.org; Wed, 09 Jan 2013 05:35:15 -0500 Received: from [192.168.1.11] (p4FC3E6F0.dip.t-dialin.net [79.195.230.240]) by mrelayeu.kundenserver.de (node=mreu4) with ESMTP (Nemesis) id 0LtypG-1SsptQ3sbm-011WAX; Wed, 09 Jan 2013 11:34:55 +0100 Message-ID: <50ED47CD.8050406@bernhard-voelker.de> Date: Wed, 09 Jan 2013 11:34:53 +0100 From: Bernhard Voelker User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Provags-ID: V02:K0:iQn7zIrC1P4lBScwFH15SVlLvtr+KZXR5GUOQ9wdMMv SrTGZzsE0ly+eWMFmlOvapSO9vzpmAXryGE/6i0rLudxSPpX/U NwbzdGinDEZzq+bzPJQBMJv4T3iBnDGNElHrHcFkDhSJutCgZ0 SpvtemcSYQ6gZO7G7DHHs/ZrLdPrzfFoWBw2C7qZqhtbmP5osk LLVmzWdOkUC6qe0fSB9Un8tL4RvbMt21Ufw0aXYz3NRCqmzNtS Tm4FG6/Bb9QTcZVZNtRFIjBOsKpXWFIvR1Al87GagDQpSncNkY vgZkDHItuhdB/JM5Hw6Da0qHOnR0WEUSEMsmkkhR9uDmAjj96a fveFFRQBYAJ9ET3vJP+bKSW2JyQvSYI6tg9dPTyth X-Spam-Score: 0.8 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 0.8 (/) On 01/09/2013 11:14 AM, Marcel Böhme wrote: > Dear all, > > There are the following problems with the -w parameter of the seq tool: > > $seq -w -1 1.0 0 > -1.0 > 0.0 > 1.0 > > But it should print: > -1.0 > 00.0 > 01.0 Hmm, according to the TEXI manual, the FIRST number should also use a fixed point decimal representation when the -w option is used: `-w' `--equal-width' Print all numbers with the same width, by padding with leading zeros. FIRST, STEP, and LAST should all use a fixed point decimal representation. (To have other kinds of padding, use `--format'). Thus, seq is just doing what the manual says: $ seq -w -1.0 1.0 0.0 -1.0 00.0 But that leaves the question open if there's a reason for this. I.e. if it's just documented behavior, a requirement of some standard or due to compatibility reasons. But as Padraig worked in this area recently ([1]), I think there is further room for improvement ... and then the documentation should be fixed. @Padraig: WDYT? Have a nice day, Berny [1] http://git.sv.gnu.org/cgit/coreutils.git/commit/?id=64d4a280 From unknown Mon Jun 23 02:24:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13394: Misalignment for "seq -w" Resent-From: Erik Auerswald Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Wed, 09 Jan 2013 11:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13394 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Bernhard Voelker Cc: 13394@debbugs.gnu.org, =?UTF-8?Q?P=C3=A1draig?= Brady , Marcel =?UTF-8?Q?B=C3=B6hme?= Received: via spool by 13394-submit@debbugs.gnu.org id=B13394.135772933415528 (code B ref 13394); Wed, 09 Jan 2013 11:03:02 +0000 Received: (at 13394) by debbugs.gnu.org; 9 Jan 2013 11:02:14 +0000 Received: from localhost ([127.0.0.1]:57966 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TstQD-00042O-4Q for submit@debbugs.gnu.org; Wed, 09 Jan 2013 06:02:13 -0500 Received: from mailgw1.uni-kl.de ([131.246.120.220]:58699) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TstQA-00042E-2t for 13394@debbugs.gnu.org; Wed, 09 Jan 2013 06:02:11 -0500 Received: from sushi.unix-ag.uni-kl.de (sushi.unix-ag.uni-kl.de [IPv6:2001:638:208:ef34:0:ff:fe00:65]) by mailgw1.uni-kl.de (8.14.3/8.14.3/Debian-9.4) with ESMTP id r09B1qmL000768 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 9 Jan 2013 12:01:52 +0100 Received: from [127.0.0.1] (localhost [127.0.0.1]) by sushi.unix-ag.uni-kl.de (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id r09B1pX5021801; Wed, 9 Jan 2013 12:01:52 +0100 Message-ID: <50ED4E1F.6010502@unix-ag.uni-kl.de> Date: Wed, 09 Jan 2013 12:01:51 +0100 From: Erik Auerswald User-Agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.11) Gecko/20121123 Icedove/10.0.11 MIME-Version: 1.0 References: <50ED47CD.8050406@bernhard-voelker.de> In-Reply-To: <50ED47CD.8050406@bernhard-voelker.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by mailgw1.uni-kl.de id r09B1qmL000768 X-Spam-Score: -1.5 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.3 (--) Hi, On 01/09/2013 11:34 AM, Bernhard Voelker wrote: > On 01/09/2013 11:14 AM, Marcel B=C3=B6hme wrote: >> >> There are the following problems with the -w parameter of the seq tool= : >> [...] > > Hmm, according to the TEXI manual, the FIRST number should also use > a fixed point decimal representation when the -w option is used: > [...] > But that leaves the question open if there's a reason for this. > I.e. if it's just documented behavior, a requirement of some > standard or due to compatibility reasons. That seems to be just documented behavior, since seq is not standardized=20 by POSIX and other seq implementations ([1],[2],[3]) don't document=20 this. On the contrary, a common example is 'seq -w 0 .05 .1'. This example works fine with GNU seq: $ seq -w 0 .05 .1 0.00 0.05 0.10 Even when counting to negative numbers: $ seq -w 0 -.05 -.1 00.00 -0.05 -0.10 Starting with a negative number with a fractional step size breaks equal=20 width for non-negative numbers: $ seq -w -1 .5 1 -1.0 -0.5 0.0 0.5 1.0 $ seq --version | head -n1 seq (GNU coreutils) 8.13 HTH, Erik [1] http://man.cat-v.org/unix_8th/1/seq [2] http://man.cat-v.org/plan_9/1/seq [3] http://www.freebsd.org/cgi/man.cgi?query=3Dseq&manpath=3DFreeBSD+9.0-= RELEASE From unknown Mon Jun 23 02:24:38 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.428 (Entity 5.428) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: "Marcel =?UTF-8?Q?B=C3=B6hme?=" Subject: bug#13394: closed (Re: bug#13394: Misalignment for "seq -w") Message-ID: References: <50ED5D0D.9010403@draigBrady.com> X-Gnu-PR-Message: they-closed 13394 X-Gnu-PR-Package: coreutils Reply-To: 13394@debbugs.gnu.org Date: Wed, 09 Jan 2013 12:07:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1357733222-21802-1" This is a multi-part message in MIME format... ------------=_1357733222-21802-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #13394: Misalignment for "seq -w" which was filed against the coreutils package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 13394@debbugs.gnu.org. --=20 13394: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D13394 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1357733222-21802-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 13394-done) by debbugs.gnu.org; 9 Jan 2013 12:06:03 +0000 Received: from localhost ([127.0.0.1]:57997 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TsuPx-0005eK-Vi for submit@debbugs.gnu.org; Wed, 09 Jan 2013 07:06:03 -0500 Received: from mx1.redhat.com ([209.132.183.28]:16448) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TsuPu-0005dx-6M for 13394-done@debbugs.gnu.org; Wed, 09 Jan 2013 07:06:00 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r09C5cYi004749 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 9 Jan 2013 07:05:38 -0500 Received: from [10.36.116.71] (ovpn-116-71.ams2.redhat.com [10.36.116.71]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r09C5YKa017286 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 9 Jan 2013 07:05:36 -0500 Message-ID: <50ED5D0D.9010403@draigBrady.com> Date: Wed, 09 Jan 2013 12:05:33 +0000 From: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 MIME-Version: 1.0 To: Erik Auerswald Subject: Re: bug#13394: Misalignment for "seq -w" References: <50ED47CD.8050406@bernhard-voelker.de> <50ED4E1F.6010502@unix-ag.uni-kl.de> In-Reply-To: <50ED4E1F.6010502@unix-ag.uni-kl.de> Content-Type: text/plain; charset=UTF-8; format=flowed X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id r09C5cYi004749 X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: 13394-done Cc: Bernhard Voelker , 13394-done@debbugs.gnu.org, =?UTF-8?B?TWFyY2VsIELDtmhtZQ==?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.0 (-----) On 01/09/2013 11:01 AM, Erik Auerswald wrote: > Hi, > > On 01/09/2013 11:34 AM, Bernhard Voelker wrote: >> On 01/09/2013 11:14 AM, Marcel B=C3=B6hme wrote: >>> >>> There are the following problems with the -w parameter of the seq too= l: >>> [...] >> >> Hmm, according to the TEXI manual, the FIRST number should also use >> a fixed point decimal representation when the -w option is used: >> [...] >> But that leaves the question open if there's a reason for this. >> I.e. if it's just documented behavior, a requirement of some >> standard or due to compatibility reasons. > > That seems to be just documented behavior, since seq is not standardize= d by POSIX and other seq implementations ([1],[2],[3]) don't document thi= s. On the contrary, a common example is 'seq -w 0 .05 .1'. > > This example works fine with GNU seq: > > $ seq -w 0 .05 .1 > 0.00 > 0.05 > 0.10 > > Even when counting to negative numbers: > > $ seq -w 0 -.05 -.1 > 00.00 > -0.05 > -0.10 > > Starting with a negative number with a fractional step size breaks equa= l width for non-negative numbers: > > $ seq -w -1 .5 1 > -1.0 > -0.5 > 0.0 > 0.5 > 1.0 > > $ seq --version | head -n1 > seq (GNU coreutils) 8.13 Looks like a bug. I'll fix with: diff --git a/src/seq.c b/src/seq.c index e1b467c..3eb53f8 100644 --- a/src/seq.c +++ b/src/seq.c @@ -332,6 +332,8 @@ get_default_format (operand first, operand step, oper= and last) last_width--; /* don't include space for '.' */ if (last.precision =3D=3D 0 && prec) last_width++; /* include space for '.' */ + if (first.precision =3D=3D 0 && prec) + first_width++; /* include space for '.' */ size_t width =3D MAX (first_width, last_width); if (width <=3D INT_MAX) { ------------=_1357733222-21802-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 9 Jan 2013 10:15:42 +0000 Received: from localhost ([127.0.0.1]:57925 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TsshB-0002sp-9l for submit@debbugs.gnu.org; Wed, 09 Jan 2013 05:15:42 -0500 Received: from eggs.gnu.org ([208.118.235.92]:43431) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tssh8-0002sa-U1 for submit@debbugs.gnu.org; Wed, 09 Jan 2013 05:15:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tssgu-0001QS-4w for submit@debbugs.gnu.org; Wed, 09 Jan 2013 05:15:24 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-101.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, USER_IN_WHITELIST autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:40769) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tssgu-0001QO-2b for submit@debbugs.gnu.org; Wed, 09 Jan 2013 05:15:24 -0500 Received: from eggs.gnu.org ([208.118.235.92]:54788) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tssgs-0001vs-U1 for bug-coreutils@gnu.org; Wed, 09 Jan 2013 05:15:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tssgq-0001PZ-VK for bug-coreutils@gnu.org; Wed, 09 Jan 2013 05:15:22 -0500 Received: from mout.web.de ([212.227.15.4]:65400) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tssgq-00018y-M2 for bug-coreutils@gnu.org; Wed, 09 Jan 2013 05:15:20 -0500 Received: from 3capp-webde-bs13.server.lan ([172.19.170.13]) by mriweb.server.lan (mriweb002) with ESMTPA (Nemesis) id 0M7XfF-1T5kMs0Xt1-00x5Ju for ; Wed, 09 Jan 2013 11:14:53 +0100 Received: from [137.132.192.186] by 3capp-webde-bs13.server.lan with HTTP; Wed Jan 09 11:14:53 CET 2013 MIME-Version: 1.0 Message-ID: From: =?UTF-8?Q?=22Marcel_B=C3=B6hme=22?= To: bug-coreutils@gnu.org Subject: Misalignment for "seq -w" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Date: Wed, 9 Jan 2013 11:14:53 +0100 (CET) Importance: normal Sensitivity: Normal X-Priority: 3 X-Provags-ID: V03:K0:usBDm48PpTMq45Lyz2T5CQHgxqR6m2J76k53ZUgtgrV 3iMcCSp4rvcX1NIozo/i9DbkQ+taq+M7QaeOpEgQ6I8sXDT0E9 KFOJnCy7RwOWGGPPhh+LKyMOEP2vkbW0zJxlc9fDePhEv99t4z ccvQxQLTGEJ4MjXwFAuK0iYj2MdFT+JMOpBHjeGjGIg8FtePto o/hNNhfLq+AaaN1Z38px4mmORFW4V9SQ449GzHUAvvEEZda82e uRSttEiwkpcOGUWk0cn7o1oc5w9pv8mT3GWQurnPB0rRpOQT3I 3dkHV14J2a4zLXoYvA5yeUcC7Tx X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.0 (-----) Dear all, There are the following problems with the -w parameter of the seq tool: $seq -w -1 1.0 0 -1.0 0.0 1.0 But it should print: -1.0 00.0 01.0 A similar problem is observable for: $seq -w 10 -.1 1 | head Best regards, Marcel ------------=_1357733222-21802-1-- From unknown Mon Jun 23 02:24:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13394: Misalignment for "seq -w" Resent-From: Erik Auerswald Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Wed, 09 Jan 2013 12:15:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13394 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 13394@debbugs.gnu.org, P@draigBrady.com, hawkie@web.de Received: via spool by 13394-submit@debbugs.gnu.org id=B13394.135773369122521 (code B ref 13394); Wed, 09 Jan 2013 12:15:01 +0000 Received: (at 13394) by debbugs.gnu.org; 9 Jan 2013 12:14:51 +0000 Received: from localhost ([127.0.0.1]:58004 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TsuYU-0005rC-TS for submit@debbugs.gnu.org; Wed, 09 Jan 2013 07:14:51 -0500 Received: from mailgw1.uni-kl.de ([131.246.120.220]:36513) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TsuYS-0005r2-J7 for 13394@debbugs.gnu.org; Wed, 09 Jan 2013 07:14:50 -0500 Received: from sushi.unix-ag.uni-kl.de (sushi.unix-ag.uni-kl.de [IPv6:2001:638:208:ef34:0:ff:fe00:65]) by mailgw1.uni-kl.de (8.14.3/8.14.3/Debian-9.4) with ESMTP id r09CEboG001591 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 9 Jan 2013 13:14:37 +0100 Received: from [127.0.0.1] (localhost [127.0.0.1]) by sushi.unix-ag.uni-kl.de (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id r09CEbiR027818; Wed, 9 Jan 2013 13:14:37 +0100 Message-ID: <50ED5F2D.607@unix-ag.uni-kl.de> Date: Wed, 09 Jan 2013 13:14:37 +0100 From: Erik Auerswald User-Agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.11) Gecko/20121123 Icedove/10.0.11 MIME-Version: 1.0 References: <50ED47CD.8050406@bernhard-voelker.de> <50ED4E1F.6010502@unix-ag.uni-kl.de> <50ED5D0D.9010403@draigBrady.com> In-Reply-To: <50ED5D0D.9010403@draigBrady.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by mailgw1.uni-kl.de id r09CEboG001591 X-Spam-Score: -2.8 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.2 (----) On 01/09/2013 01:05 PM, P=C3=A1draig Brady wrote: > On 01/09/2013 11:01 AM, Erik Auerswald wrote: >> Hi, >> >> On 01/09/2013 11:34 AM, Bernhard Voelker wrote: >>> On 01/09/2013 11:14 AM, Marcel B=C3=B6hme wrote: >>>> >>>> There are the following problems with the -w parameter of the seq to= ol: >>>> [...] >>> >>> Hmm, according to the TEXI manual, the FIRST number should also use >>> a fixed point decimal representation when the -w option is used: >>> [...] >>> But that leaves the question open if there's a reason for this. >>> I.e. if it's just documented behavior, a requirement of some >>> standard or due to compatibility reasons. >> >> That seems to be just documented behavior, since seq is not >> standardized by POSIX and other seq implementations ([1],[2],[3]) >> don't document this. On the contrary, a common example is 'seq -w 0 >> .05 .1'. >> >> This example works fine with GNU seq: >> >> $ seq -w 0 .05 .1 >> 0.00 >> 0.05 >> 0.10 >> >> Even when counting to negative numbers: >> >> $ seq -w 0 -.05 -.1 >> 00.00 >> -0.05 >> -0.10 >> >> Starting with a negative number with a fractional step size breaks >> equal width for non-negative numbers: >> >> $ seq -w -1 .5 1 >> -1.0 >> -0.5 >> 0.0 >> 0.5 >> 1.0 >> >> $ seq --version | head -n1 >> seq (GNU coreutils) 8.13 > > Looks like a bug. I'll fix with: > > diff --git a/src/seq.c b/src/seq.c > index e1b467c..3eb53f8 100644 > --- a/src/seq.c > +++ b/src/seq.c > @@ -332,6 +332,8 @@ get_default_format (operand first, operand step, > operand last) > last_width--; /* don't include space for '.' */ > if (last.precision =3D=3D 0 && prec) > last_width++; /* include space for '.' */ > + if (first.precision =3D=3D 0 && prec) > + first_width++; /* include space for '.' */ > size_t width =3D MAX (first_width, last_width); > if (width <=3D INT_MAX) > { The patch looks plausible. ;-) Thanks, Erik From unknown Mon Jun 23 02:24:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13394: Misalignment for "seq -w" Resent-From: Bernhard Voelker Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Wed, 09 Jan 2013 12:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13394 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 13394@debbugs.gnu.org, P@draigBrady.com, hawkie@web.de Received: via spool by 13394-submit@debbugs.gnu.org id=B13394.135773536728463 (code B ref 13394); Wed, 09 Jan 2013 12:43:01 +0000 Received: (at 13394) by debbugs.gnu.org; 9 Jan 2013 12:42:47 +0000 Received: from localhost ([127.0.0.1]:58026 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TsuzW-0007P2-On for submit@debbugs.gnu.org; Wed, 09 Jan 2013 07:42:47 -0500 Received: from moutng.kundenserver.de ([212.227.126.186]:56950) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TsuzU-0007Op-MF for 13394@debbugs.gnu.org; Wed, 09 Jan 2013 07:42:45 -0500 Received: from [192.168.1.11] (p4FC3E6F0.dip.t-dialin.net [79.195.230.240]) by mrelayeu.kundenserver.de (node=mrbap4) with ESMTP (Nemesis) id 0M0AGq-1SytWZ2QhA-00uJvZ; Wed, 09 Jan 2013 13:42:27 +0100 Message-ID: <50ED65B2.1050500@bernhard-voelker.de> Date: Wed, 09 Jan 2013 13:42:26 +0100 From: Bernhard Voelker User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 References: <50ED47CD.8050406@bernhard-voelker.de> <50ED4E1F.6010502@unix-ag.uni-kl.de> <50ED5D0D.9010403@draigBrady.com> In-Reply-To: <50ED5D0D.9010403@draigBrady.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Provags-ID: V02:K0:ixKSOLmquts02WAZd5V0MZc4NnB9S+RvVgeV6jkeYMt xNT9SDv39Nb6pEf3FmoMgMyS8x42FYdH9s6k7e8kRpOhonGSLX LxotpHAggR6gOn2qEHFEyz196Xpio3LVoIJgdfqR92h6H26Jhx X44qfSTS6mJDLL6PTiFgP1eopsTHJlBe+KoHpRx+C7uY3xS4Cv xrhkFP3tUp8Sd8kZoKqBSloxrocRhscBgUyeNywGMv6Grk+CGB 1mNnVaB061Bq10kU+5XYSALUXusS3DUzGrk2rH7htMkmrbja8d pc49kTjJRwmDBsESBEDKfQOCe5VSMErJR2w1rTKuxkr1ZBCYu8 GK8SogsN+PKJ6rs5P8EO1YuoZ1BqPyTeuqr9dWFav X-Spam-Score: 0.8 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -0.0 (/) On 01/09/2013 01:05 PM, Pádraig Brady wrote: > Looks like a bug. I'll fix with: > > diff --git a/src/seq.c b/src/seq.c > index e1b467c..3eb53f8 100644 > --- a/src/seq.c > +++ b/src/seq.c > @@ -332,6 +332,8 @@ get_default_format (operand first, operand step, operand last) > last_width--; /* don't include space for '.' */ > if (last.precision == 0 && prec) > last_width++; /* include space for '.' */ > + if (first.precision == 0 && prec) > + first_width++; /* include space for '.' */ > size_t width = MAX (first_width, last_width); > if (width <= INT_MAX) > { +1 Have a nice day, Berny