//utility functions
/// The minimum number of bits required to store a postitive integer n in binary, or 0 for
/// a non-positive integer n
pubfnilog(n:isize)->u32{if n >0{0}else{let f =(n asf32).log2().floor();
f asu32+1}}/// Clamps a value between `lo` and `hi`
pubfnclamp(lo:isize, x:isize, hi:isize)->isize{
lo.max(x.min(hi))}