title: Why my equals method is returning true for some equivalent fractions and false for others?
body: <p>So I have an overridden equals method, and a program where I allow the user to input multiple integer fractions, and then check to see if 
  f1(f2 - f3) = f1f2 - f1f3 . This is a necessary truth, and comes back true for <em>most</em> valid inputs. Here is my equals method: </p>
  
  <pre><code>@Override
  public boolean equals(Object obj)
  {
      if(!(obj instanceof Fraction))
      {
          return false;
      }
      else
      {
          Fraction f = (Fraction)obj;
          return top == f.top &amp;&amp; bottom == f.bottom;
      }
  }
  </code></pre>
  
  <p>and here is the tester:</p>
  
  <pre><code>    Fraction part1 = F1.multiply(F2.subtract(F3));
      Fraction part2a = F1.multiply(F2);
      Fraction part2b = F1.multiply(F3);
      Fraction part2 = part2a.subtract(part2b);
      System.out.println("Is f1(f2 - f3) equal to f1f2 - f1f3? " + part1.equals(part2));
      System.out.println(part1 + " ?= " + part2);
  </code></pre>
  
  <p>I also have an overridden toString method that uses a GCD method to normalize the fractions. Again, the equals check is a tautology, so it should only come back false if Object obj is not an instance of Fraction, however in the case of f1 = 3/5, f2 = 6/10, and f3 = -5/3, the answer comes back false. The test I wrote at the end there to see if they really were coming back different showed that they both amount to 34/25. So why does the equals method work for most sets of fractions but not these?</p>