UNPKG

chinese-remainder

Version:

A lightweight NPM package for solving modular equations using the Chinese Remainder Theorem (CRT). Supports modular inverse, LCM, and GCD calculations.

6 lines (4 loc) 101 B
function gcd(a, b) { return b === 0 ? Math.abs(a) : gcd(b, a % b); } module.exports = gcd;