divisors-and-multiples
v1.0.1
Published
A simple npm package that allows you to get all the divisors of a number (1-1000) or multiples from the number itself to the number * 100!
Downloads
7
Maintainers
Readme
Divisors And Multiples
What is this package, and what does it do?
- This is a simple package that allows you to get all the numbers a number can be divided with, or get all the multiples of anynumber!
Installation
npm install divisors-and-multiples
Usage
const divisorsAndMultiples = require('divisors-and-multiples'); // requiring the package
console.log(divisorsAndMultiples.findDivisors(6)); // output: [1, 2, 3, 6]
console.log(divisorsAndMultiples.findMultiples(4)); // output: [4, 8, 12, 16,..., 400]
NOTE
- The limit for the number in
findDivisors
andfindMultiples
is 99,999,999. One of the reasons that number is max is speed. - Depending on the number you give, the functions go and try to divide/multiply your number with every number from 1 to 99,999,999 so it makes our code run slower if the number is bigger...