title: How does Excel successfully round floating point numbers even though they are imprecise?
body: <p>For example, <a href="http://blogs.office.com/b/microsoft-excel/archive/2008/04/10/understanding-floating-point-precision-aka-why-does-excel-give-me-seemingly-wrong-answers.aspx" rel="noreferrer">this blog</a> says 0.005 is not exactly 0.005, but rounding that number yields the right result.</p>
  
  <p>I have tried all kinds of rounding in C++ and it fails when rounding numbers to certain decimal places. For example, Round(x,y) rounds x to a multiple of y. So Round(37.785,0.01) should give you 37.79 and not 37.78. </p>
  
  <p>I am reopening this question to ask the community for help. The problem is with the impreciseness of floating point numbers (37,785 is represented as 37.78499999999).</p>
  
  <p>The question is how does Excel get around this problem?</p>
  
  <p>The solution in this <a href="https://stackoverflow.com/questions/485525/round-for-float-in-c">round() for float in C++</a> is incorrect for the above problem.</p>