W64.down32: def of bend-collections-laws-math@1.0.0.0 Import: import bend-collections-laws-math@1.0.0.0/src/math/w64.bend as W64 Lines 428-437 of bend-collections-laws-math@1.0.0.0/src/math/w64.bend: https://jend.leeeet.dev/read.txt?path=bend-collections-laws-math@1.0.0.0/src/math/w64.bend&start_line=428&end_line=437 import Base # r - 1 while r * r > x: from r <= 65535 at most r steps (fuel r + 1), and # r * r never wraps def down32(fuel: Nat, +x: U32, +r: U32, over: Bool) -> U32: match fuel over: case 0n _: r case 1n+f False{}: r case 1n+f True{}: down32(f, x, U32.sub(r, 1), U32.is_lt(x, U32.mul(U32.sub(r, 1), U32.sub(r, 1)))) 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=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_lt https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.mul https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.sub