Generic.ilog_go: def of bend-collections-laws-crypto@1.0.0.0 Import: import bend-collections-laws-crypto@1.0.0.0/src/math/generic.bend as Generic Lines 416-424 of bend-collections-laws-crypto@1.0.0.0/src/math/generic.bend: https://jend.leeeet.dev/read.txt?path=bend-collections-laws-crypto@1.0.0.0/src/math/generic.bend&start_line=416&end_line=424 import Base import bend-collections-laws-crypto@1.0.0.0/src/math/num.bend as N # the largest k with b^k <= n; p <= n / b is asked before p * b is formed def ilog_go(~T: Data, ~op: N.Op -> T, ~test: N.Test -> Bool, fuel: Nat, +q: T, +b: T, +k: Nat, +p: T, up: Bool) -> Nat: match fuel up: case 0n _: k case 1n+f False{}: k case 1n+f True{}: ilog_go(~T, ~op, ~test, f, q, b, 1n+k, op(N.Mul{p, b}), le(~T, ~test, op(N.Mul{p, b}), q)) 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=bend-collections-laws-crypto@1.0.0.0/src/math/generic.bend&name=le https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/src/math/num.bend&name=Op https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/src/math/num.bend&name=Test