File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -942,10 +942,15 @@ 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://en.wikipedia.org/wiki/NaN#Encoding
948+ # https://gcc.gnu.org/onlinedocs/gcc-15.2.0/gcc/MIPS-Options.html#index-mnan_003d2008
949+ if not platform .machine ().startswith ('mips' ):
950+ packed = struct .pack ('<e' , math .nan )
951+ self .assertEqual (packed [1 ] & 0x7e , expected )
952+ packed = struct .pack ('<e' , - math .nan )
953+ self .assertEqual (packed [1 ] & 0x7e , expected )
949954
950955 # Checks for round-to-even behavior
951956 format_bits_float__rounding_list = [
You can’t perform that action at this time.
0 commit comments