1.0.1 • Published 2 years ago

divisors-and-multiples v1.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

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 and findMultiples 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...