title: How can I get the results of multiplying 2 doubles, and allow up to 1% error?
body: <p>Lets say I have program that will generate 2 random doubles, and then asks the user what is the answer. </p>
  
  <p>An example would be the code below, given that num1 and num2 is randomly generated, and userAnswer is the answer that the user has keyed in.</p>
  
  <pre><code>if(num1 * num2 == userAnswer)
  {
      System.out.Println("You are right!");
  }
  </code></pre>
  
  <p>I understand that multiplying doubles would never be accurate, but how can I change this code to allow errors up to 3 decimal points? I want the console to still display "You are right", even though the answer is 2.1453000001 and the user answers 2.145.</p>