title: Possible loss of precision?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2389457/java-loss-of-precision">Java loss of precision</a>  </p>
  </blockquote>
  
  
  
  <p>ok so for a program that I'm writing I have called "Flight" I created a method that calculates the amount of fuel to be used during the flight. I am getting 2 errors on my code though that says "possible loss of precision found: double required: int" can anyone help me find out why I'm getting this error?</p>
  
  <p>here is my code for that method: </p>
  
  <pre><code>public double calculateFuel(){
      if (numofmiles&lt;1000){
        numofmiles = numofmiles*2;
      }
      else if (numofmiles&gt;1000 &amp;&amp; numofmiles&lt;3000){
        numofmiles = numofmiles*1.75;
      }
      else if (numofmiles&gt;3000){
        numofmiles = numofmiles*1.5;
      }
      //basing off of that a plane goes 30 miles on 1 gallon
      double fuel = numofmiles/30;
  
      return fuel;
    }
  </code></pre>