[issue7010] Rounding when converting float tuple to str
report at bugs.python.org
Mon Sep 28 09:43:58 CEST 2009
New submission from Per Rosengren <per.rosengren at gmail.com>:
When a floating point value is stored, the actual value stored is
something at most some small number eps larger or smaller than the
original value. Python knows this, so if it stores 0.1, and then prints
the stored value, it rounds off decimals less significant than eps.
For some reason, if it prints a tuple with the same value, it doesn't do
the rounding properly. This behavior is incorrect, and very annoying for
instance when printing manually entered constants in tuples.
'''Shows that floats in tuples are not rounded like floats.
components: Interpreter Core
title: Rounding when converting float tuple to str
versions: Python 2.6, Python 3.0
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list