Skip to content

taylordotfish/is-number-divisible-by-other-number

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.