def shrink_signed(): x = (0xff, -8) res = bitmap.shrink(x, 4) if res == (15, -4) and bitmap.value(res) == -1: raise Success
def shrink_unsigned(): x = (0x50, 8) res = bitmap.shrink(x, 4) if res == (5, 4) and bitmap.value(res) == 5: raise Success
def int(self): n = self.bitmap() # clamp to 30-bits... if n[1] > 30: n = bitmap.shrink(n, n[1] - 30) return n[0]
def shrink_signed(): x = (0xff, -8) res = bitmap.shrink(x, 4) if res == (15,-4) and bitmap.value(res) == -1: raise Success
def shrink_unsigned(): x = (0x50, 8) res = bitmap.shrink(x, 4) if res == (5,4) and bitmap.value(res) == 5: raise Success