core.bitop.bsr without the undefined behaviour. smartOp.bsr(0) will raise IntFlag.undef.
import checkedint.noex : smartOp; assert(smartOp.bsr( 20) == 4); assert(smartOp.bsr(-20) == 31); smartOp.bsr(0); assert(IntFlags.local.clear() == IntFlag.undef);
See Implementation
core.bitop.bsr without the undefined behaviour. smartOp.bsr(0) will raise IntFlag.undef.