2.0.1 • Published 3 years ago

prime-factorization v2.0.1

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

Prime Factorization Calculator

After you installed the package, place this in your code:

const module = require('prime-factorization');

Factorize a number

There are different ways to factorize (19386 as an example):

const firstMethod = module.Factorize(19386, 'asArray'); //result in array
const secondMethod = module.Factorize(19386, 'asArrayExp'); //exponentiates same numbers
const thirdMethod = module.Factorize(19386, 'asObject'); //shows all calculations

console.log(firstMethod) //returns [2, 3, 3, 3, 359]
console.log(secondMethod) //returns [2, 27, 359]
console.log(thirdMethod) //returns { 'Calculation 0': '1100 ÷ 2', 'Calculation 1': '550 ÷ 2', 'Calculation 2': '275 ÷ 5', 'Calculation 3': '55 ÷ 5', 'Calculation 4': '11 ÷ 11' }

Check if number is Prime

const myVar = module.IsPrime(111) //will return either true or false
console.log(myVar) //returns true

For the web interface: https://helloworld-html.github.io/Prime-Factorization-Calculator/

Please report any bugs or errors, thanks for your contribution!

2.0.1

3 years ago

2.0.0

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.1.3

3 years ago

1.0.4

3 years ago

1.1.2

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago