1.0.1 • Published 3 years ago
is-number-divisible-by-other-number v1.0.1
is-number-divisible-by-other-number
Check if a number is divisible by another number.
Inspired by @an-empty-string’s package divisibility.
Usage
Simply call the appropriate function!
const isNumberDivisibleByOtherNumber = require("is-number-divisible-by-other-number");
isNumberDivisibleByOtherNumber.isSixDivisibleByThree(); // => true
isNumberDivisibleByOtherNumber.isSixDivisibleByFour(); // => false
isNumberDivisibleByOtherNumber.isTwoHundredTwentyOneDivisibleBySeventeen(); // => true
You can even test large numbers!
isNumberDivisibleByOtherNumber.isFourteenMillionFiftyEightThousandSixHundredNinetyFourDivisibleBySevenMillionTwentyNineThousandThreeHundredFortySeven(); // => true
isNumberDivisibleByOtherNumber.isFourteenMillionFiftyEightThousandSixHundredNinetyFourDivisibleBySevenMillionTwentyNineThousandThreeHundredFortyEight(); // => false
Tests
is-number-divisible-by-other-number uses Jest for tests.
To run the tests:
npm install
npm test
License
is-number-divisible-by-other-number is licensed under the GNU Affero General Public License, version 3.0 or later; see LICENSE.