diff options
author | apense <apense@users.noreply.github.com> | 2015-06-02 17:11:03 -0400 |
---|---|---|
committer | apense <apense@users.noreply.github.com> | 2015-06-02 17:11:03 -0400 |
commit | 860da53db50d515df54d24241529388d96eafc1a (patch) | |
tree | a76653be3b94df276f039b21f618b2713f2e8fc8 | |
parent | 79c92603f505c388d370c5ef0dd8890e4e17e4e0 (diff) | |
download | Nim-860da53db50d515df54d24241529388d96eafc1a.tar.gz |
Added slight explanation for count{down|up}
The inclusivity of a..b (that it is from a <= n <= b) wasn't clear.
-rw-r--r-- | lib/system.nim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/system.nim b/lib/system.nim index 205a68685..fbb3cbfc7 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -1578,7 +1578,7 @@ else: type IntLikeForCount = int|int8|int16|int32|char|bool|uint8|uint16|enum iterator countdown*[T](a, b: T, step = 1): T {.inline.} = - ## Counts from ordinal value `a` down to `b` with the given + ## Counts from ordinal value `a` down to `b` (inclusive) with the given ## step count. `T` may be any ordinal type, `step` may only ## be positive. **Note**: This fails to count to ``low(int)`` if T = int for ## efficiency reasons. @@ -1606,7 +1606,7 @@ template countupImpl(incr: stmt) {.immediate, dirty.} = incr iterator countup*[S, T](a: S, b: T, step = 1): T {.inline.} = - ## Counts from ordinal value `a` up to `b` with the given + ## Counts from ordinal value `a` up to `b` (inclusive) with the given ## step count. `S`, `T` may be any ordinal type, `step` may only ## be positive. **Note**: This fails to count to ``high(int)`` if T = int for ## efficiency reasons. |