title: Why does C# Math.Ceiling round down?
body: <p>I'm having a rough day, but something is not adding up correctly.</p>
  
  <p>In my C# code, I have this:</p>
  
  <pre><code>Math.Ceiling((decimal)(this.TotalRecordCount / this.PageSize))
  </code></pre>
  
  <p>Where <code>(int)TotalRecordCount</code> = 12 and <code>(int)PageSize</code> = 5. The result I am getting is 2.<br>
  (Both values are <code>int</code> values.)</p>
  
  <p>By my calculations,  12 / 5 = 2.4. I thought Math.Ceiling would always round up, and in this case, give me 3?</p>
  
  <p>PS, if I do this:</p>
  
  <pre><code>Math.Ceiling(this.TotalRecordCount / this.PageSize)
  </code></pre>
  
  <p>I get the message:</p>
  
  <blockquote>
    <p>Math.Ceiling(this.TotalRecordCount / this.PageSize)<br>
    The call is ambiguous between the following methods or properties:<br>
    'System.Math.Ceiling(decimal)' and 'System.Math.Ceiling(double)'    </p>
  </blockquote>