Natural.gcd_go: def of bend-collections-laws-crypto@1.0.0.0 Import: import bend-collections-laws-crypto@1.0.0.0/src/math/natural.bend as Natural Lines 49-57 of bend-collections-laws-crypto@1.0.0.0/src/math/natural.bend: https://jend.leeeet.dev/read.txt?path=bend-collections-laws-crypto@1.0.0.0/src/math/natural.bend&start_line=49&end_line=57 import Base # Euclid's algorithm; b <= fuel throughout (every step lowers b). def gcd_go(fuel: Nat, +a: Nat, +b: Nat) -> Nat: match fuel b: case 0n _: a case 1n+f 0n: a case 1n+f 1n+ +bp: gcd_go(f, 1n+bp, Nat.mod(a, 1n+bp)) Uses (2): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.mod