- All Implemented Interfaces:
- Serializable, Comparable<BigRational>
public class BigRational
extends Number
implements Comparable<BigRational>
Represents rational numbers. The denominator is always a positive integer.
The rational is usually reduced -- that is, gcd(m_numerator,m_denominator)==1.
Furthermore, m_denominator is usually greated than one.
These restrictions are used in .equals(). Sometimes, however,
rationals are created that do not satisfy this condition. In such cases,
.equals() and .hasCode() may return incorrect values. This hack has been introduced
to enable efficient comparison of rationals with other kinds of numbers in the
Numbers class. The compareTo() method always returns correct values.
- See Also:
- Serialized Form