Merge pull request #2861 from apense/patch-5
Added slight explanation for count{down|up}
This commit is contained in:
commit
86f58a002d
1 changed files with 2 additions and 2 deletions
|
|
@ -1578,7 +1578,7 @@ else:
|
||||||
type IntLikeForCount = int|int8|int16|int32|char|bool|uint8|uint16|enum
|
type IntLikeForCount = int|int8|int16|int32|char|bool|uint8|uint16|enum
|
||||||
|
|
||||||
iterator countdown*[T](a, b: T, step = 1): T {.inline.} =
|
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
|
## 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
|
## be positive. **Note**: This fails to count to ``low(int)`` if T = int for
|
||||||
## efficiency reasons.
|
## efficiency reasons.
|
||||||
|
|
@ -1606,7 +1606,7 @@ template countupImpl(incr: stmt) {.immediate, dirty.} =
|
||||||
incr
|
incr
|
||||||
|
|
||||||
iterator countup*[S, T](a: S, b: T, step = 1): T {.inline.} =
|
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
|
## 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
|
## be positive. **Note**: This fails to count to ``high(int)`` if T = int for
|
||||||
## efficiency reasons.
|
## efficiency reasons.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue