Why round(4.5) == 4 and round(5.5) == 6 in Python 3.5?
<p>Looks like both 4.5 and 5.5 have exact float representations in Python 3.5:</p>

<pre><code>&gt;&gt;&gt; from decimal import Decimal
&gt;&gt;&gt; Decimal(4.5)
Decimal('4.5')
&gt;&gt;&gt; Decimal(5.5)
Decimal('5.5')
</code></pre>

<p>If this is the case, then why</p>

<pre><code>&gt;&gt;&gt; round(4.5)
4
&gt;&gt;&gt; round(5.5)
6
</code></pre>

<p>?</p>

<p>Python 3 uses Bankers Rounding, which rounds <code>.5</code> values to the closest even number.</p>

python floating-point floating-accuracy