Fix test_partsig's invalid result for the equals test
authorMichael Nolan <mtnolan2640@gmail.com>
Thu, 6 Feb 2020 02:11:25 +0000 (21:11 -0500)
committerMichael Nolan <mtnolan2640@gmail.com>
Thu, 6 Feb 2020 02:11:25 +0000 (21:11 -0500)
src/ieee754/part/test/test_partsig.py

index 29a26faabcbe38085eabf161beb75d215c8851d0..4b46e1cee9b75f9d5fbfc715b8801b1a33abf4b7 100644 (file)
@@ -102,7 +102,8 @@ class TestPartitionPoints(unittest.TestCase):
                     # do the partitioned tests
                     for i, mask in enumerate(mask_list):
                         if (a & mask) == (b & mask):
-                            y |= maskbit_list[i]
+                            # OR y with the lowest set bit in the mask
+                            y |= (maskbit_list[i] & ~(maskbit_list[i]-1))
                     # check the result
                     outval = (yield module.eq_output)
                     msg = f"{msg_prefix}: 0x{a:X} == 0x{b:X}" + \