def bit_length_go
import bend-collections-laws-math@1.0.0.0/src/math/natural.bend as Naturalimport Base
157def bit_length_go(fuel: Nat, +n: Nat, +k: Nat) -> Nat:
158 match fuel n:
159 case 0n _:
160 k
161 case 1n+f 0n:
162 k
163 case 1n+f 1n+ +np:
164 bit_length_go(f, Nat.div(1n+np, 2n), 1n+k)
Uses (2)
Used by (13)
- bend-collections-laws-math@1.0.0.0/src/math/natural:bit_length
- bend-collections-laws-math@1.0.0.0/proofs/math/typed/w64clz:bl_succ
- bend-collections-laws-math@1.0.0.0/proofs/math/natural/bits:go_acc
- bend-collections-laws-math@1.0.0.0/proofs/math/typed/natfuel:bl_140
- bend-collections-laws-math@1.0.0.0/proofs/math/typed/natfuel:bl_fuel
- …