(a: bigint, b: bigint)
| 7 | } |
| 8 | |
| 9 | export 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 |
no test coverage detected