divisors-and-multiples

1.0.1 • Public • Published

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

Package Sidebar

Install

npm i divisors-and-multiples

Weekly Downloads

1

Version

1.0.1

License

ISC

Unpacked Size

2.13 kB

Total Files

3

Last publish

Collaborators

  • cxstin