title: floating point calculations in awk
body: <p>I am surprised with behaviour of <code>awk</code> while performing <strong>floating point</strong> calculations. It lead me to wrong calculation on table data. </p>
  
  <pre><code>$ awk 'BEGIN {print 2.3/0.1}'
  23  &lt;-- Ok
  $ awk 'BEGIN {print int(2.3/0.1)}'
  22  &lt;-- Wrong!
  
  $ awk 'BEGIN {print 2.3-2.2==0.1}'
  0   &lt;-- Surprise!
  $ awk 'BEGIN {print 2.3-2.2&gt;0.1}'  &lt;-- Din't produce any output :(
  $ awk 'BEGIN {print 2.3-2.2&lt;0.1}'
  1   &lt;-- Totally confused now ...
  </code></pre>
  
  <p>Can somebody throw light as to what's happing here?</p>
  
  <p><strong>EDIT 1</strong></p>
  
  <p>As pointed by <em>@fedorqui</em>, output of second last command goes to file named <strong>0.1</strong> because of redirection operator (<strong>></strong>). </p>
  
  <p>Then how am I supposed to perform <em>greater than</em> (<strong>></strong>) operation?</p>
  
  <p>Solution to it is also given by <em>@fedorqui</em></p>
  
  <pre><code>$ awk 'BEGIN {print (2.3-2.2&gt;0.1)}'
  0  &lt;-- Wrong!
  </code></pre>