Description Usage Arguments Value Examples
Returns an iterator that returns pieces of numeric value.
1 |
n |
number of times that the iterator will fire. If not specified, it will count forever. |
... |
unused. |
chunks |
the number of pieces that |
chunkSize |
the maximum size of the pieces that |
The dividing iterator.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | # divide the value 10 into 3 pieces
it <- idiv(10, chunks=3)
nextElem(it)
nextElem(it)
nextElem(it)
try(nextElem(it)) # expect a StopIteration exception
# divide the value 10 into pieces no larger than 3
it <- idiv(10, chunkSize=3)
nextElem(it)
nextElem(it)
nextElem(it)
nextElem(it)
try(nextElem(it)) # expect a StopIteration exception
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.