Package Exports
- modulo-n
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (modulo-n) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
modulo-n
Get unique number results based on unique inputs using modulo-n classes.
For a specific integer and range, you will always get the same number result. It could happen to find different inputs for which the result will be the same. That's expected.
☁️ Installation
$ npm i --save modulo-n
📋 Example
const moduloN = require("modulo-n");
console.log(moduloN(42, 4, 8));
// => 6
console.log(moduloN(42, 2, 8));
// => 2
console.log(moduloN(43, 2, 8));
// => 3
📝 Documentation
moduloN(n, min, max)
Returns a number that will be unique for a specific n
and range.
Params
- Number
n
: The input number. - Number
min
: The minimum number in the range. - Number
max
: The maximum number in the range.
Return
- Number A number that will greater or equal to
min
but lower thanmax
and will be always the same for the same range and samen
.
😋 How to contribute
Have an idea? Found a bug? See how to contribute.
💰 Donations
Another way to support the development of my open-source modules is to set up a recurring donation, via Patreon. 🚀
PayPal donations are appreciated too! Each dollar helps.
Thanks! ❤️
💫 Where is this library used?
If you are using this library in one of your projects, add it in this list. ✨
numberly
—Get a specific number for an input string and number range.