def test_equality_normalizable_subnormal(self): p = IBMFloat(bytes((0x10, 0x04, 0x00, 0x00))) assert p.is_subnormal() q = IBMFloat(bytes((0x10, 0x05, 0x00, 0x00))) assert q.is_subnormal() assert p != q
def test_is_subnormal(self, a): buffer = bytes([a, 0, 0, 0]) ibm = IBMFloat(buffer) assert ibm.is_subnormal()
def test_normalize_zero(self): zero = IBMFloat(bytes((0x32, 0x00, 0x00, 0x00))) assert zero.is_subnormal() nzero = zero.normalize() assert bytes(nzero) == bytes((0x00, 0x00, 0x00, 0x00))