GNU bug report logs - #23110
seq apparent bug

Previous Next

Package: coreutils;

Reported by: Маренков Евгений <hotpil <at> mail.ru>

Date: Thu, 24 Mar 2016 17:23:03 UTC

Severity: normal

Tags: fixed

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


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

From: Bernhard Voelker <mail <at> bernhard-voelker.de>
To: Pádraig Brady <P <at> draigBrady.com>,
 Ruediger Meier <sweet_f_a <at> gmx.de>, 23110 <at> debbugs.gnu.org,
 Paul Eggert <eggert <at> cs.ucla.edu>
Subject: Re: bug#23110: seq apparent bug
Date: Thu, 14 Apr 2016 18:37:51 +0200
[Message part 1 (text/plain, inline)]
On 04/07/2016 08:18 PM, Pádraig Brady wrote:
> I agree that we should avoid repeating output with "0" STEP.

Thanks.  I improved the error diagnostic by outputting the original
value from the user:

[PATCH 1/2] seq: do not allow 0 as increment value

> Do we want to deal with these cases spinning the cpu?
> 
>    seq 1 nan 1

This is addressed with the second patch:

[PATCH 2/2] seq: do not allow NaN arguments

>    seq 1 .0000000000000000000000000000001 1

I consider this a bug in seq: from mathematical point of view, the above
should just output "1" and then exit, because after adding that tiny number
the next number would be greater than LAST.

IMO we should enhance seq_fast() to do all the Math when no special
output format is given.
WDYT?

> As an aside, I see FreeBSD requires the STEP to be in the right direction
> when FIRST != LAST, or it will also exit with error.
> GNU will just output nothing in that case.

I think GNU seq's behavior is okay, and therefore I agree with Paul in
http://lists.gnu.org/archive/html/bug-coreutils/2016-04/msg00032.html

Have a nice day,
Berny
[0001-seq-do-not-allow-0-as-increment-value.patch (text/x-patch, attachment)]
[0002-seq-do-not-allow-NaN-arguments.patch (text/x-patch, attachment)]

This bug report was last modified 6 years and 210 days ago.

Previous Next


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