time-to-botec/squiggle/node_modules/@stdlib/ndarray/base/wrap-index/docs/repl.txt

30 lines
424 B
Plaintext
Raw Normal View History

{{alias}}( idx, max )
Wraps an index on the interval `[0,max]`.
Parameters
----------
idx: integer
Index to wrap.
max: integer
Maximum index value.
Returns
-------
out: integer
Wrapped index.
Examples
--------
> var idx = {{alias}}( 2, 10 )
2
> idx = {{alias}}( -4, 10 )
7
> idx = {{alias}}( 13, 10 )
2
See Also
--------