cyclic-next
v1.0.1
Published
Get the cyclic next integer number.
Downloads
19
Maintainers
Readme
cyclic-next
Get the cyclic next integer.
Features
Finds the cyclic next integer of a given number given the maximum bound.
e.g.
Given maximum bound of 5
1
/ \
0 2
\ /
4-3
cyclic next of 4
will be 0
.
Install
npm install cyclic-next
Usage
import cyclicNext from 'cyclic-next';
cyclicNext(5, 0) //=> 1
cyclicNext(5, 1) //=> 2
cyclicNext(5, 2) //=> 3
cyclicNext(5, 3) //=> 4
cyclicNext(5, 4) //=> 0
cyclicNext(5, 4, 1) //=> 0
cyclicNext(5, 4, 3) //=> 2
Author
License
Contributing
Contributions are highly welcome! This repo is commitizen friendly — please read about it here.