Bigint.BigInt.gcd: def of bend-kit-bignum@0.1.0.0 Import: import bend-kit-bignum@0.1.0.0/bigint.bend as Bigint Lines 460-465 of bend-kit-bignum@0.1.0.0/bigint.bend: https://jend.leeeet.dev/read.txt?path=bend-kit-bignum@0.1.0.0/bigint.bend&start_line=460&end_line=465 import Base # Never negative; gcd(0, 0) is 0. def BigInt.gcd(a: BigInt, b: BigInt) -> BigInt: match a b: case BigInt{sa, +x} BigInt{sb, +y}: BigInt{False{}, Mag.gcd( Nat.add(Nat.mul(Nat.add(Mag.len(x), Mag.len(y)), 20n), 2n), x, y)} Uses (6): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.mul https://jend.leeeet.dev/definition.txt?path=bend-kit-bignum@0.1.0.0/bigint.bend&name=BigInt https://jend.leeeet.dev/definition.txt?path=bend-kit-bignum@0.1.0.0/bigint.bend&name=Mag.gcd https://jend.leeeet.dev/definition.txt?path=bend-kit-bignum@0.1.0.0/bigint.bend&name=Mag.len