Skip to content

Latest commit

 

History

History
44 lines (31 loc) · 1.28 KB

File metadata and controls

44 lines (31 loc) · 1.28 KB

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.