Check if a number is divisible by another number.
Inspired by @an-empty-string’s package divisibility.
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
is-number-divisible-by-other-number uses Jest for tests.
To run the tests:
npm install
npm test
is-number-divisible-by-other-number is licensed under the GNU Affero General Public License, version 3.0 or later; see LICENSE.