def test_high_bit_set_1(self): # Start with the float32 value for the bit pattern 0x80000001. result = fixup_float32_as_int32(-1.401298464324817e-45) self.assertEqual(result, -1)
def test_high_bit_set_2(self): # Start with the float32 value for the bit pattern 0x80000002. result = fixup_float32_as_int32(-2.802596928649634e-45) self.assertEqual(result, -2)
def test_negative_zero(self): result = fixup_float32_as_int32(-0.0) self.assertEqual(result, 0)