U32.U32Nat.low: def of bend-osdev-u32@0.1.0.0 Import: import bend-osdev-u32@0.1.0.0/u32.bend as U32 Lines 56-63 of bend-osdev-u32@0.1.0.0/u32.bend: https://jend.leeeet.dev/read.txt?path=bend-osdev-u32@0.1.0.0/u32.bend&start_line=56&end_line=63 import Base # the low k bits of x (x mod 2^k), and the rest (x / 2^k, rounded down): # x = low(k, x) + 2^k high(k, x) def U32Nat.low(k: Nat, +x: Nat) -> Nat: match k: case 0n: 0n case 1n+j: Nat.add(U32Nat.odd(x), Nat.double(U32Nat.low(j, U32Nat.half(x)))) Uses (5): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.double https://jend.leeeet.dev/definition.txt?path=bend-osdev-u32@0.1.0.0/u32.bend&name=U32Nat.half https://jend.leeeet.dev/definition.txt?path=bend-osdev-u32@0.1.0.0/u32.bend&name=U32Nat.odd