title: What is going on here? The formula is correct but the answer isn't
body: <pre><code>public static double Fraction2Decimal(int Numerator, int Denominator)
  {
      double Answer = Numerator / Denominator;
      return Answer;
  }
  
  public static void main(String args[])
  {
      double ans = Fraction2Decimal(2, 8);
  
      double pi = 3.141592653589793238462643383;
      System.out.print(ans);
  }
  </code></pre>
  
  <p>What this code is doing is converting fractions to a decimal/double, 2/8 as a decimal is 0.25 as everyone knows but IntelliJ IDE returns this </p>
  
  <pre><code>0.0
  Process finished with exit code 0
  </code></pre>
  
  <p>Huh! its should return 0.25, could anyone explain what is going on here?</p>
  
  <p>EDIT:
  I only did by just to check that the type was to short for the answer.</p>