W64.up32: def of bend-collections-laws-crypto@1.0.0.0 Import: import bend-collections-laws-crypto@1.0.0.0/src/math/w64.bend as W64 Lines 442-450 of bend-collections-laws-crypto@1.0.0.0/src/math/w64.bend: https://jend.leeeet.dev/read.txt?path=bend-collections-laws-crypto@1.0.0.0/src/math/w64.bend&start_line=442&end_line=450 import Base # r + 1 while r < 65535 and (r + 1)^2 <= x: at most 65535 - r steps def up32(fuel: Nat, +x: U32, +r: U32, up: Bool) -> U32: match fuel up: case 0n _: r case 1n+f False{}: r case 1n+f True{}: up32(f, x, U32.add(r, 1), up_ok(x, U32.add(r, 1))) Uses (5): 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=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.add https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/src/math/w64.bend&name=up_ok