title: Java precision during division and multiplication alterneting process
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/179427/how-to-resolve-a-java-rounding-double-issue">How to resolve a Java Rounding Double issue</a>  </p>
  </blockquote>
  
  
  
  <p>Please Help, 
  I programm some calculator in Java. I use double type. Double has 15 digits after the decimal point. I have problem with the following:</p>
  
  <p>1/3 * 3 = 0.9999999999999999</p>
  
  <p>I need 1/3 * 3 = 1</p>
  
  <p>How can I solve this problem?
  I keep result in Double. The same problem I have with other mathematical operations, for example</p>
  
  <p>sqrt(6) = 2.449489742783, and next I square the result and I get: 5.999999999999999</p>