[issue3024] Integer conversion inconsistent

Razvan Cosma report at bugs.python.org
Mon Jun 2 00:31:18 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:
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"))
-23
>>> int(float("-23.65"))
-23
>>> int(float("24.9"))
24
>>> int(float("24.4"))
24
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>
<http://bugs.python.org/issue3024>
_______________________________________


More information about the Python-bugs-list mailing list