title: How to round a double to the nearest 10th place
body: <pre><code>public double hypotenuse()
  {       
      //return Math.hypot(leg, leg); //returns 7.0710678118654755
      //return 0.1 * Math.floor(Math.hypot(leg, leg) * 10); //returns 7.0
      //return 0.1 * Math.ceil(Math.hypot(leg, leg) * 10); //returns 7.1000000000000005
      return 0.1 * Math.round(Math.hypot(leg, leg) * 10); //returns 7.1000000000000005
  }
  </code></pre>
  
  <p>I am trying to round to the nearest 10th place, so this number should round up to 7.1.  Why does this method work with Math.floor but not with Math.round?   Does anyone have any insight?  </p>
  
  <p>Thanks, </p>
  
  <p>Sky</p>