mirror of
https://github.com/python/cpython.git
synced 2025-07-28 21:55:21 +00:00
Fix integer negation and absolute value to not rely
on undefined behaviour of the C compiler anymore. Will backport to 2.5 and 2.4.
This commit is contained in:
parent
82271f13e7
commit
820d6ac9d7
3 changed files with 7 additions and 4 deletions
|
@ -116,6 +116,7 @@ class BuiltinTest(unittest.TestCase):
|
|||
self.assertEqual(abs(0), 0)
|
||||
self.assertEqual(abs(1234), 1234)
|
||||
self.assertEqual(abs(-1234), 1234)
|
||||
self.assertTrue(abs(-sys.maxint-1) > 0)
|
||||
# float
|
||||
self.assertEqual(abs(0.0), 0.0)
|
||||
self.assertEqual(abs(3.14), 3.14)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue