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.

8 lines (5 loc) 152 B
const extendedGCD = require("./extendedGCD"); function isCoprime(a, b) { return extendedGCD(a, b).gcd === 1; } module.exports = isCoprime;