Big Fraction

Big Fraction is a Java class that represents an immutable fraction, as held in a numerator and denominator. Calculations may be performed on this fraction, but the value is always held as a numerator/denominator pair. Therefore, no precision is lost. The fraction may be top-heavy, but is reduced when printed. The value can be converted into floats if desired, although precision will invariably be lost, and some large fractions (such as calculations for pi) can not be converted if the values of BigInteger exceed the range capable of floats. (Source: