Number.egcd_go: def of bend-collections-laws-math@1.0.0.0 Import: import bend-collections-laws-math@1.0.0.0/src/math/number.bend as Number Lines 48-56 of bend-collections-laws-math@1.0.0.0/src/math/number.bend: https://jend.leeeet.dev/read.txt?path=bend-collections-laws-math@1.0.0.0/src/math/number.bend&start_line=48&end_line=56 import Base # b <= fuel throughout, as in natural.bend's gcd_go def egcd_go(fuel: Nat, +a: Nat, +b: Nat) -> EGcd: match fuel b: case 0n _: EG{a, 1n, 0n, False{}} case 1n+f 0n: EG{a, 1n, 0n, False{}} case 1n+ +f 1n+ +bp: eg_up(Nat.div(a, 1n+bp), egcd_go(f, 1n+bp, Nat.mod(a, 1n+bp))) 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 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.div https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.mod https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/src/math/number.bend&name=EGcd https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/src/math/number.bend&name=eg_up