U32.log2.go: def of Base Import: import Base Lines 1576-1583 of Base/base.bend: https://jend.leeeet.dev/read.txt?path=Base/base.bend&start_line=1576&end_line=1583 import Base def U32.log2.go(+k: Nat, +n: U32, b: Nat) -> Nat: match k: case 0n: b case 1n+p: +s = U32.to_nat(U32.shln(1, p)) +t = Nat.mul(s, U32.to_nat(Bool.to_u32(U32.is_ne(U32.shrn(n, s), 0)))) U32.log2.go(p, U32.shrn(n, t), Nat.add(b, t)) Uses (9): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.to_u32 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.mul 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_ne https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.shln https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.shrn https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.to_nat