Wide.div_million: def of bend-collections-laws-math@1.0.0.0 Import: import bend-collections-laws-math@1.0.0.0/proofs/lib/lemmas/src/wide.bend as Wide Lines 75-84 of bend-collections-laws-math@1.0.0.0/proofs/lib/lemmas/src/wide.bend: https://jend.leeeet.dev/read.txt?path=bend-collections-laws-math@1.0.0.0/proofs/lib/lemmas/src/wide.bend&start_line=75&end_line=84 import Base # Binary long division, processing the most significant bit first. The partial # remainder stays below 1,000,000; the next candidate fits in U32 (<2,000,000). def div_million(+n: Nat, w: Word(n)) -> Division: match n: case 0n: Div{WNil{}, 0} case 1n+p: match w: case WCon{b, tail}: digit(p, b, div_million(p, tail)) Uses (6): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Word https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Word.Con https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Word.Nil https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/proofs/lib/lemmas/src/wide.bend&name=Division https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/proofs/lib/lemmas/src/wide.bend&name=digit