def bitlen
import bend-collections-laws-math@1.0.0.0/src/math/w64.bend as W64import Base
224# the number of bits of x (0 for 0), by a binary search on the top bit
225def bitlen(+x: U32) -> Nat:
226 bl_fin(bl_step(1n, bl_step(2n, bl_step(4n, bl_step(8n, bl_step(16n, (0n, x)))))))
Uses (5)
Used by (15)
- bend-collections-laws-math@1.0.0.0/src/math/w64:dm_pick
- bend-collections-laws-math@1.0.0.0/src/math/f64:div_q
- bend-collections-laws-math@1.0.0.0/proofs/math/typed/w64est:est_t
- bend-collections-laws-math@1.0.0.0/proofs/math/typed/w64est:est_up
- bend-collections-laws-math@1.0.0.0/proofs/math/typed/f64divf:dgen
- …