GNU bug report logs - #13394
Misalignment for "seq -w"

Previous Next

Package: coreutils;

Reported by: "Marcel Böhme" <hawkie <at> web.de>

Date: Wed, 9 Jan 2013 10:16:02 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 13394 <at> debbugs.gnu.org (full text, mbox):

From: Erik Auerswald <auerswal <at> unix-ag.uni-kl.de>
To: Bernhard Voelker <mail <at> bernhard-voelker.de>
Cc: 13394 <at> debbugs.gnu.org,
	Pádraig Brady <P <at> draigbrady.com>,
	Marcel Böhme <hawkie <at> web.de>
Subject: Re: bug#13394: Misalignment for "seq -w"
Date: Wed, 09 Jan 2013 12:01:51 +0100
Hi,

On 01/09/2013 11:34 AM, Bernhard Voelker wrote:
> On 01/09/2013 11:14 AM, Marcel Böhme 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 
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

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=seq&manpath=FreeBSD+9.0-RELEASE




This bug report was last modified 12 years and 138 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.