mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
SF bug #444510: int() should guarantee truncation.
It's guaranteed now, assuming the platform modf() works correctly.
This commit is contained in:
parent
7cf92fa1c8
commit
7321ec437b
3 changed files with 27 additions and 10 deletions
|
@ -366,6 +366,19 @@ except ValueError:
|
|||
pass
|
||||
else:
|
||||
raise TestFailed, "int(%s)" % `s[1:]` + " should raise ValueError"
|
||||
try:
|
||||
int(1e100)
|
||||
except OverflowError:
|
||||
pass
|
||||
else:
|
||||
raise TestFailed("int(1e100) expected OverflowError")
|
||||
try:
|
||||
int(-1e100)
|
||||
except OverflowError:
|
||||
pass
|
||||
else:
|
||||
raise TestFailed("int(-1e100) expected OverflowError")
|
||||
|
||||
|
||||
# SF bug 434186: 0x80000000/2 != 0x80000000>>1.
|
||||
# Worked by accident in Windows release build, but failed in debug build.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue