 <p>It is worthwhile to note that Python 3.1 has a new floating point output routine that rounds this in the expected manner (it has also been backported to Python 2.7):</p> <pre><code>Python 3.1 (r31:73572, Aug 15 2009, 17:12:41) [GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin Type "help", "copyright", "credits" or "license" for more information. &gt;&gt;&gt; a = [3.14] &gt;&gt;&gt; print(a) [3.14] </code></pre> <p>From the <a href="http://docs.python.org/py3k/whatsnew/3.1.html" rel="nofollow noreferrer">What's New in Python 3.1</a> document:</p> <blockquote> <p>Python now uses David Gay’s algorithm for finding the shortest floating point representation that doesn’t change its value. This should help mitigate some of the confusion surrounding binary floating point numbers.</p> <p>The significance is easily seen with a number like 1.1 which does not have an exact equivalent in binary floating point. Since there is no exact equivalent, an expression like <code>float('1.1')</code> evaluates to the nearest representable value which is <code>0x1.199999999999ap+0</code> in hex or <code>1.100000000000000088817841970012523233890533447265625</code> in decimal. That nearest value was and still is used in subsequent floating point calculations.</p> </blockquote>