SF bug #444510: int() should guarantee truncation.

It's guaranteed now, assuming the platform modf() works correctly.
This commit is contained in:
Tim Peters 2001-07-26 20:02:17 +00:00
parent 7cf92fa1c8
commit 7321ec437b
3 changed files with 27 additions and 10 deletions

View file

@ -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.