These are BigFractions. What are a, b, c and d? BigIntegers a c ----- vs ---- (vs is > < >= <= != ==) b d ad vs bc multipy both sides by bd which is > 0. ad - bc vs 0 a.multiply(d).subtract( b.multiply(c) ) vs 0 (a.multiply(d).subtract(b.multiply(c))).compareTo(BigInteger.ZERO)