mirror of
https://github.com/python/cpython.git
synced 2025-11-01 06:01:29 +00:00
Issue #23185: add math.inf and math.nan constants.
This commit is contained in:
parent
845b14cc8e
commit
a5d0c7c2fd
5 changed files with 69 additions and 1 deletions
|
|
@ -983,6 +983,17 @@ def testIsinf(self):
|
|||
self.assertFalse(math.isinf(0.))
|
||||
self.assertFalse(math.isinf(1.))
|
||||
|
||||
@requires_IEEE_754
|
||||
def test_nan_constant(self):
|
||||
self.assertTrue(math.isnan(math.nan))
|
||||
|
||||
@requires_IEEE_754
|
||||
def test_inf_constant(self):
|
||||
self.assertTrue(math.isinf(math.inf))
|
||||
self.assertGreater(math.inf, 0.0)
|
||||
self.assertEqual(math.inf, float("inf"))
|
||||
self.assertEqual(-math.inf, float("-inf"))
|
||||
|
||||
# RED_FLAG 16-Oct-2000 Tim
|
||||
# While 2.0 is more consistent about exceptions than previous releases, it
|
||||
# still fails this part of the test on some platforms. For now, we only
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue