@@ -922,6 +922,7 @@ def testHypot(self):
922922 @requires_IEEE_754
923923 @unittest .skipIf (HAVE_DOUBLE_ROUNDING ,
924924 "hypot() loses accuracy on machines with double rounding" )
925+ @support .skip_on_newlib
925926 def testHypotAccuracy (self ):
926927 # Verify improved accuracy in cases that were known to be inaccurate.
927928 #
@@ -1253,12 +1254,6 @@ def testLog2(self):
12531254 self .assertEqual (math .log2 (4 ), 2.0 )
12541255 self .assertEqual (math .log2 (MyIndexable (4 )), 2.0 )
12551256
1256- # Large integer values
1257- self .assertEqual (math .log2 (2 ** 1023 ), 1023.0 )
1258- self .assertEqual (math .log2 (2 ** 1024 ), 1024.0 )
1259- self .assertEqual (math .log2 (2 ** 2000 ), 2000.0 )
1260- self .assertEqual (math .log2 (MyIndexable (2 ** 2000 )), 2000.0 )
1261-
12621257 self .assertRaises (ValueError , math .log2 , 0.0 )
12631258 self .assertRaises (ValueError , math .log2 , 0 )
12641259 self .assertRaises (ValueError , math .log2 , MyIndexable (0 ))
@@ -1276,12 +1271,19 @@ def testLog2(self):
12761271 @requires_IEEE_754
12771272 # log2() is not accurate enough on Mac OS X Tiger (10.4)
12781273 @support .requires_mac_ver (10 , 5 )
1274+ @support .skip_on_newlib
12791275 def testLog2Exact (self ):
12801276 # Check that we get exact equality for log2 of powers of 2.
12811277 actual = [math .log2 (math .ldexp (1.0 , n )) for n in range (- 1074 , 1024 )]
12821278 expected = [float (n ) for n in range (- 1074 , 1024 )]
12831279 self .assertEqual (actual , expected )
12841280
1281+ # Large integer values
1282+ self .assertEqual (math .log2 (2 ** 1023 ), 1023.0 )
1283+ self .assertEqual (math .log2 (2 ** 1024 ), 1024.0 )
1284+ self .assertEqual (math .log2 (2 ** 2000 ), 2000.0 )
1285+ self .assertEqual (math .log2 (MyIndexable (2 ** 2000 )), 2000.0 )
1286+
12851287 def testLog10 (self ):
12861288 self .assertRaises (TypeError , math .log10 )
12871289 self .ftest ('log10(0.1)' , math .log10 (0.1 ), - 1 )
@@ -2615,6 +2617,7 @@ def test_fma_nan_results(self):
26152617 self .assertIsNaN (math .fma (a , math .nan , b ))
26162618 self .assertIsNaN (math .fma (a , b , math .nan ))
26172619
2620+ @support .skip_on_newlib
26182621 def test_fma_infinities (self ):
26192622 # Cases involving infinite inputs or results.
26202623 positives = [1e-300 , 2.3 , 1e300 , math .inf ]
@@ -2685,7 +2688,7 @@ def test_fma_infinities(self):
26852688 # gh-73468: On some platforms, libc fma() doesn't implement IEE 754-2008
26862689 # properly: it doesn't use the right sign when the result is zero.
26872690 @unittest .skipIf (
2688- sys .platform .startswith (("freebsd" , "wasi" , "netbsd" , "emscripten" ))
2691+ sys .platform .startswith (("freebsd" , "wasi" , "netbsd" , "emscripten" , "cygwin" ))
26892692 or (sys .platform == "android" and platform .machine () == "x86_64" )
26902693 or support .linked_to_musl (), # gh-131032
26912694 f"this platform doesn't implement IEE 754-2008 properly" )
@@ -2743,6 +2746,7 @@ def test_fma_zero_result(self):
27432746 self .assertIsNegativeZero (math .fma (y - x , - (x + y ), - z ))
27442747 self .assertIsPositiveZero (math .fma (x - y , - (x + y ), z ))
27452748
2749+ @support .skip_on_newlib
27462750 def test_fma_overflow (self ):
27472751 a = b = float .fromhex ('0x1p512' )
27482752 c = float .fromhex ('0x1p1023' )
@@ -2776,11 +2780,13 @@ def test_fma_overflow(self):
27762780 c = float .fromhex ('0x1.fffffffffffffp+1023' )
27772781 self .assertEqual (math .fma (a , b , - c ), c )
27782782
2783+ @support .skip_on_newlib
27792784 def test_fma_single_round (self ):
27802785 a = float .fromhex ('0x1p-50' )
27812786 self .assertEqual (math .fma (a - 1.0 , a + 1.0 , 1.0 ), a * a )
27822787
2783- def test_random (self ):
2788+ @support .skip_on_newlib
2789+ def test_fma_random (self ):
27842790 # A collection of randomly generated inputs for which the naive FMA
27852791 # (with two rounds) gives a different result from a singly-rounded FMA.
27862792
0 commit comments