0.0.10 • Published 4 years ago

@japan-d2/rho v0.0.10

Weekly downloads
6
License
MIT
Repository
-
Last release
4 years ago

rho

Compute prime factors using Pollard's rho algorithm.

install

npm install @japan-d2/rho

or

yarn add @japan-d2/rho

how to use

example

import rho from '@japan-d2/rho'
console.log(rho(451341))

Output

[3, 3, 11, 47, 97]

methods

rho(n: number): number[]

Returns the prime factors of n sorted in ascending order.

BigInt support

example

import rho from '@japan-d2/rho/lib/bigint'
console.log(rho(451341n))

Output

[3n, 3n, 11n, 47n, 97n]

methods

rho(n: bigint): bigint[]

Returns the prime factors of n sorted in ascending order.

license

MIT

0.0.10

4 years ago

0.0.9

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago