bug-coreutils
[Top][All Lists]
Advanced

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

bug#23110: seq apparent bug


From: Bernhard Voelker
Subject: bug#23110: seq apparent bug
Date: Thu, 14 Apr 2016 18:37:51 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0

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

Attachment: 0001-seq-do-not-allow-0-as-increment-value.patch
Description: Text Data

Attachment: 0002-seq-do-not-allow-NaN-arguments.patch
Description: Text Data


reply via email to

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