mirror of
https://github.com/python/cpython.git
synced 2026-01-06 07:22:09 +00:00
merge 3.2
This commit is contained in:
commit
29037720d1
1 changed files with 6 additions and 0 deletions
|
|
@ -128,6 +128,12 @@ def __float__(self):
|
|||
self.assertRaises(TypeError, float, Foo4(42))
|
||||
self.assertAlmostEqual(float(FooStr('8')), 9.)
|
||||
|
||||
def test_is_integer(self):
|
||||
self.assertFalse((1.1).is_integer())
|
||||
self.assertTrue((1.).is_integer())
|
||||
self.assertFalse(float("nan").is_integer())
|
||||
self.assertFalse(float("inf").is_integer())
|
||||
|
||||
def test_floatasratio(self):
|
||||
for f, ratio in [
|
||||
(0.875, (7, 8)),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue