title: Lua math ceil round up number when there is no digits after decimal point
body: <p>I would like to round up the numbers by using math.ceil in Lua.</p>
  
  <p>Some of the cases are make sense like:</p>
  
  <ul>
  <li>ceil(260.5) -> 261</li>
  </ul>
  
  <p>But some of the cases are weird like:</p>
  
  <ul>
  <li>ceil(2.2*100) -> 221 # Suppose there is no round up and the answer is 220</li>
  </ul>
  
  <p>I have no idea why it acts like this, what should I do if I would like to round up the number when there are digits after decimal point, and no rounding up if there is just an integer?</p>
  
  <p>-- Update:
  Thanks for the answering from @cyclaminist:
  2.2 * 100 is actually a little larger than 220.0 because 2.2 can't be represented exactly as a floating point number. Try ('%.15f'):format(2.2 * 100): for me, it gives '220.000000000000028'</p>
  
  <p>Ceil will return the integer which is the closest and not smaller than 220.000000000000028, so that 221 is returned.</p>
  
  <p>The solution to get 220 is:
  math.floor(2.2*100 + 0.5) -> return 220, Since math.floor return the closest but not larger than 220.000000000000028</p>