File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -935,12 +935,13 @@ def test_half_float(self):
935935 self .assertTrue (math .isnan (struct .unpack ('<e' , bits )[0 ]))
936936 self .assertTrue (math .isnan (struct .unpack ('>e' , bits [::- 1 ])[0 ]))
937937
938- if sys .platform != 'win32' :
939- # Check round-trip for NaN's:
940- nan = struct .unpack ('<e' , bits )[0 ]
941- self .assertEqual (struct .pack ('<e' , nan ), bits )
942- nan = struct .unpack ('>e' , bits [::- 1 ])[0 ]
943- self .assertEqual (struct .pack ('>e' , nan ), bits [::- 1 ])
938+ # Check round-trip for NaN's:
939+ if sys .platform == 'win32' and int .from_bytes (bits [::- 1 ]) & (1 << 9 ):
940+ continue # doesn't work for sNaN's here
941+ nan = struct .unpack ('<e' , bits )[0 ]
942+ self .assertEqual (struct .pack ('<e' , nan ), bits )
943+ nan = struct .unpack ('>e' , bits [::- 1 ])[0 ]
944+ self .assertEqual (struct .pack ('>e' , nan ), bits [::- 1 ])
944945
945946 # Check that packing produces a bit pattern representing a quiet NaN:
946947 # all exponent bits and the msb of the fraction should all be 1.
You can’t perform that action at this time.
0 commit comments