@@ -830,7 +830,7 @@ def test_short_repr(self):
830
830
self .assertEqual (repr (float (negs )), str (float (negs )))
831
831
832
832
@support .requires_IEEE_754
833
- class RoundTestCase (unittest .TestCase ):
833
+ class RoundTestCase (unittest .TestCase , FloatsAreIdenticalMixin ):
834
834
835
835
def test_inf_nan (self ):
836
836
self .assertRaises (OverflowError , round , INF )
@@ -860,10 +860,10 @@ def test_large_n(self):
860
860
861
861
def test_small_n (self ):
862
862
for n in [- 308 , - 309 , - 400 , 1 - 2 ** 31 , - 2 ** 31 , - 2 ** 31 - 1 , - 2 ** 100 ]:
863
- self .assertEqual (round (123.456 , n ), 0.0 )
864
- self .assertEqual (round (- 123.456 , n ), - 0.0 )
865
- self .assertEqual (round (1e300 , n ), 0.0 )
866
- self .assertEqual (round (1e-320 , n ), 0.0 )
863
+ self .assertFloatsAreIdentical (round (123.456 , n ), 0.0 )
864
+ self .assertFloatsAreIdentical (round (- 123.456 , n ), - 0.0 )
865
+ self .assertFloatsAreIdentical (round (1e300 , n ), 0.0 )
866
+ self .assertFloatsAreIdentical (round (1e-320 , n ), 0.0 )
867
867
868
868
def test_overflow (self ):
869
869
self .assertRaises (OverflowError , round , 1.6e308 , - 308 )
0 commit comments