[New-bugs-announce] [issue3024] Integer conversion inconsistent

Razvan Cosma report at bugs.python.org
Mon Jun 2 00:31:17 CEST 2008

New submission from Razvan Cosma <helminthe at gmail.com>:

This issue is probably older than I am, and was amazed to discover it in
Python 2.5.2 (r252:60911, May  7 2008, 15:19:09)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
>>> int(float("-23.15"))
>>> int(float("-23.65"))
>>> int(float("24.9"))
>>> int(float("24.4"))
Is this by design? What is the python way of obtaining a correct result?

components: None
messages: 67609
nosy: helminthe
severity: normal
status: open
title: Integer conversion inconsistent
versions: Python 2.5

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list