Skip to content

Commit

Permalink
docs: factors
Browse files Browse the repository at this point in the history
  • Loading branch information
gkucmierz committed Nov 1, 2024
1 parent c242e51 commit 3fb7a78
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/factors.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@


/**
* Prime factorization
* @function
* @param {Number} number
* @return {Number} result
*/
export const factors = n => {
if (n < 2) return [];
const res = [];
Expand All @@ -16,6 +21,12 @@ export const factors = n => {
return res;
};

/**
* Prime factorization (BigInt version)
* @function
* @param {BigInt} number
* @return {BigInt} result
*/
export const factorsBI = n => {
if (n < 2n) return [];
const res = [];
Expand Down

0 comments on commit 3fb7a78

Please sign in to comment.