Subject: Re: bug#23110: seq apparent bug

From: Paul Eggert <[email-masked]>
Date: Fri, 8 Apr 2016 12:45:17 -0700

On 04/08/2016 05:57 AM, Pádraig Brady wrote:
> Do we want to deal with these cases spinning the cpu,
> in further patches?
>
>    seq 1 nan 1

NaN should be an error in any of the operands.

> seq 1 .0000000000000000000000000000001 1

For this I suggest the following heuristic. When inferring a format that 
would apply to two or more lines of output, try formatting the first two 
lines and report an error if they are the same. That would catch the 
seeming infinite loop (and at any rate, inadequate output) in this example.

>
> 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. 

Outputting nothing sounds better. 'seq 1 0' is like 'for (i = 1; i <= 0; 
i++) ...'