MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / lcm

Function lcm

src/compute-engine/numerics/numeric-bigint.ts:9–11  ·  view source on GitHub ↗
(a: bigint, b: bigint)

Source from the content-addressed store, hash-verified

7}
8
9export function lcm(a: bigint, b: bigint): bigint {
10 // `lcm(0, n) = 0`: the general formula would divide by `gcd(0, 0) = 0`.
11 if (a === 0n || b === 0n) return 0n;
12 return (a * b) / gcd(a, b);
13}
14

Callers 2

carmichaelLambdaFunction · 0.90
rationalGcdFunction · 0.90

Calls 1

gcdFunction · 0.70

Tested by

no test coverage detected