title: How to properly round-up half float numbers?
body: <p>I am facing a strange behavior of the <code>round()</code> function:</p>
  
  <pre><code>for i in range(1, 15, 2):
      n = i / 2
      print(n, "=&gt;", round(n))
  </code></pre>
  
  <p>This code prints:</p>
  
  <pre><code>0.5 =&gt; 0
  1.5 =&gt; 2
  2.5 =&gt; 2
  3.5 =&gt; 4
  4.5 =&gt; 4
  5.5 =&gt; 6
  6.5 =&gt; 6
  </code></pre>
  
  <p>I expected the floating values to be always rounded up, but instead, it is rounded to the nearest even number.</p>
  
  <p>Why such behavior, and what is the best way to get the correct result?</p>
  
  <p>I tried to use the <a href="https://docs.python.org/3.5/library/fractions.html" rel="noreferrer"><code>fractions</code></a> but the result is the same.</p>