title: Integer division with rounding
body: <p>I need to do integer division. I expect the following to return <code>2</code> instead of the actual <code>1</code>:</p>
  
  <pre><code>187 / 100 # =&gt; 1
  </code></pre>
  
  <p>This:</p>
  
  <pre><code>(187.to_f / 100).round # =&gt; 2
  </code></pre>
  
  <p>will work, but does't seem elegant as a solution. Isn't there an integer-only operator that does <code>187 / 100 = 2</code>?</p>
  
  <hr>
  
  <p>EDIT</p>
  
  <p>I'll be clearer on my use case since I keep getting down-voted:</p>
  
  <p>I need to calculate taxes on a price. All my prices are in cents. There is nothing below 1 cent in the accountability world so I <strong>need</strong> to make sure all my prices are integers (those people checking taxes don't like mistakes... really!)</p>
  
  <p>But on the other hand, the tax rate is <code>19%</code>.</p>
  
  <p>So I wanted to find the best way to write:</p>
  
  <pre><code>def tax_price(price)
    price * TAX_RATE / 100
  end
  </code></pre>
  
  <p>that <strong>surely</strong> returns an integer, without any floating side effect.</p>
  
  <p>I was afraid of going to the <code>float</code>ing world because it has very weird side-effects on number representation like:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/11445123/ruby-strange-issue-with-floating-point-multiplication">Ruby strange issue with floating point multiplication</a></li>
  <li><a href="https://stackoverflow.com/questions/4055618/ruby-floating-point-errors">ruby floating point errors</a></li>
  </ul>
  
  <p>So I found it safer to stay in the <code>integer</code> or the <a href="https://en.wikipedia.org/wiki/Fraction_(mathematics)" rel="nofollow noreferrer"><code>fractional</code></a> world, hence my question.</p>