]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
doc: clarify when seq ends
authorBernhard Voelker <mail@bernhard-voelker.de>
Sat, 10 Aug 2013 15:19:06 +0000 (17:19 +0200)
committerBernhard Voelker <mail@bernhard-voelker.de>
Sat, 10 Aug 2013 15:19:06 +0000 (17:19 +0200)
* doc/coreutils.texi (seq invocation): Add a sentence clarifying
that seq terminates when LAST becomes smaller than the current number
plus INCREMENT.
* src/seq.c (usage): Likewise.
Fixes http://bugs.gnu.org/15068

doc/coreutils.texi
src/seq.c

index aef5cc9f98defd24210931d4d244004990810fbb..21216b4be7ef643bde8d8adbffa9bbb615fb0c7c 100644 (file)
@@ -16810,6 +16810,9 @@ When @var{increment} is not specified, it defaults to @samp{1},
 even when @var{first} is larger than @var{last}.
 @var{first} also defaults to @samp{1}.  So @code{seq 1} prints
 @samp{1}, but @code{seq 0} and @code{seq 10 5} produce no output.
+The sequence of numbers ends when the sum of the current number and
+@var{increment} would become greater than @var{last},
+so @code{seq 1 10 10} only produces @samp{1}.
 Floating-point numbers may be specified.  @xref{Floating point}.
 
 The program accepts the following options.  Also see @ref{Common options}.
index acbe2350a535d2f0355642117425ff0e52289f36..35dfc8bd091da889c353eeec8714760ed03b2d8d 100644 (file)
--- a/src/seq.c
+++ b/src/seq.c
@@ -87,6 +87,8 @@ Print numbers from FIRST to LAST, in steps of INCREMENT.\n\
 \n\
 If FIRST or INCREMENT is omitted, it defaults to 1.  That is, an\n\
 omitted INCREMENT defaults to 1 even when LAST is smaller than FIRST.\n\
+The sequence of numbers ends when the sum of the current number and\n\
+INCREMENT would become greater than LAST.\n\
 FIRST, INCREMENT, and LAST are interpreted as floating point values.\n\
 INCREMENT is usually positive if FIRST is smaller than LAST, and\n\
 INCREMENT is usually negative if FIRST is greater than LAST.\n\