time-to-botec/js/node_modules/@stdlib/ndarray/base/clamp-index/docs/repl.txt
NunoSempere b6addc7f05 feat: add the node modules
Necessary in order to clearly see the squiggle hotwiring.
2022-12-03 12:44:49 +00:00

30 lines
428 B
Plaintext

{{alias}}( idx, max )
Restricts an index to the interval [0,max].
Parameters
----------
idx: integer
Index to clamp.
max: integer
Maximum index value.
Returns
-------
out: integer
Clamped index.
Examples
--------
> var idx = {{alias}}( 2, 10 )
2
> idx = {{alias}}( -5, 10 )
0
> idx = {{alias}}( 15, 10 )
10
See Also
--------