title: java weird double return
body: <p>I wrote this function, but I really don't understand why do I have this output.</p>
  
  <p>Function:</p>
  
  <pre><code>double itr = 1.0;
  
  public double findClosestXupper(double xone, double fxone) {
      double xtwo, fxtwo;
      xtwo = xone + itr;
      fxtwo = xtwo - Math.pow(xtwo, 2);
      if(fxone &lt; 0) {
          if(fxtwo &lt; 0) {
              System.out.println("check1 " + xtwo + "    " + fxtwo);
              xtwo = xone - itr;
              fxtwo = xtwo - Math.pow(xtwo, 2);
              System.out.println("check2 " + xtwo + "    " + fxtwo);
              if(fxtwo &lt; 0) {
                  itr = itr + 1.0;
                  System.out.println("check3 " + xtwo + "    " + fxtwo);
                  findClosestXupper(xone, fxone);
              }
          }
      }
      System.out.println("check4 " + xtwo + "    " + fxtwo);
      return xtwo;
  }
  </code></pre>
  
  <p>Output: (having as input xone = 3.2; fxone = 3.2 - 3.2^2 -- negative variable)</p>
  
  <pre><code>check1 4.2    -13.440000000000001
  check2 2.2    -2.6400000000000006
  check3 2.2    -2.6400000000000006
  check1 5.2    -21.840000000000003
  check2 1.2000000000000002    -0.2400000000000002
  check3 1.2000000000000002    -0.2400000000000002
  check1 6.2    -32.24
  check2 0.20000000000000018    0.16000000000000011
  check4 0.20000000000000018    0.16000000000000011
  check4 1.2000000000000002    -0.2400000000000002
  check4 2.2    -2.6400000000000006
  </code></pre>
  
  <p>Why does check4 is displayed three times? From where 000000000000002 comes from?
  Thank you!</p>