core.bitop.bsr without the undefined behaviour. smartOp.bsr(0) will raise IntFlag.undef.
1 import checkedint.sticky : smartOp; 2 3 assert(smartOp.bsr( 20) == 4); 4 assert(smartOp.bsr(-20) == 31); 5 6 smartOp.bsr(0); 7 assert(IntFlags.local.clear() == IntFlag.undef);
See Implementation
core.bitop.bsr without the undefined behaviour. smartOp.bsr(0) will raise IntFlag.undef.