Pewarta Proxy

📋 Server Request & Proxy Logs

Loading active proxy settings...
Developed by Khairul Adha (adhexa.id)
Mengambil log server...

⚙️ Pengaturan Proxy Target

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
GH-94808: Cover handling non-finite numbers from round when ndigits i…
…s provided (GH-94860)

(cherry picked from commit 625ba9b)

Co-authored-by: Michael Droettboom <mdboom@gmail.com>
  • Loading branch information
mdboom authored and miss-islington committed Jul 15, 2022
commit 4d0c077064ed76eae630924984865c7505f07477
5 changes: 5 additions & 0 deletions Lib/test/test_float.py
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,11 @@ def test_inf_nan(self):
self.assertRaises(TypeError, round, NAN, "ceci n'est pas un integer")
self.assertRaises(TypeError, round, -0.0, 1j)

def test_inf_nan_ndigits(self):
self.assertEqual(round(INF, 0), INF)
self.assertEqual(round(-INF, 0), -INF)
self.assertTrue(math.isnan(round(NAN, 0)))

def test_large_n(self):
for n in [324, 325, 400, 2**31-1, 2**31, 2**32, 2**100]:
self.assertEqual(round(123.456, n), 123.456)
Expand Down