File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -942,10 +942,14 @@ def test_half_float(self):
942942 else :
943943 expected = 0x7e
944944
945- packed = struct .pack ('<e' , math .nan )
946- self .assertEqual (packed [1 ] & 0x7e , expected )
947- packed = struct .pack ('<e' , - math .nan )
948- self .assertEqual (packed [1 ] & 0x7e , expected )
945+ # Skip NaN encoding checks for MIPS because `math.nan` changes its value
946+ # depending on toolchain settings. See:
947+ # https://gcc.gnu.org/onlinedocs/gcc/MIPS-Options.html#index-mnan_003d2008
948+ if not platform .machine ().startswith ('mips' ):
949+ packed = struct .pack ('<e' , math .nan )
950+ self .assertEqual (packed [1 ] & 0x7e , expected )
951+ packed = struct .pack ('<e' , - math .nan )
952+ self .assertEqual (packed [1 ] & 0x7e , expected )
949953
950954 # Checks for round-to-even behavior
951955 format_bits_float__rounding_list = [
You can’t perform that action at this time.
0 commit comments