def clz
import bend-collections@1.0.0.0/src/math/w64.bend as W64import Base
import bend-collections@1.0.0.0/src/math/u64.bend as W
553# the number of leading zero bits of a (64 for 0)
554def clz(+a: W.U64) -> Nat:
555 clz_pick(a, Bool.not(U32.is_zero(hi(a))))