Skip to content

Commit d2de1f7

Browse files
committed
Add INF, NINF and NAN test cases for math.fabs()
1 parent 57d4446 commit d2de1f7

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

Lib/test/test_math.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,9 @@ def testFabs(self):
510510
self.ftest('fabs(-1)', math.fabs(-1), 1)
511511
self.ftest('fabs(0)', math.fabs(0), 0)
512512
self.ftest('fabs(1)', math.fabs(1), 1)
513+
self.ftest('fabs(INF)', math.fabs(INF), INF)
514+
self.ftest('fabs(NINF)', math.fabs(NINF), INF)
515+
self.assertTrue(math.isnan(math.fabs(NAN)))
513516

514517
def testFloor(self):
515518
self.assertRaises(TypeError, math.floor)

0 commit comments

Comments
 (0)