public interface Rational
Rational numbers of arbitrary precision.
Method Summary | |
---|---|
Rational
|
abs()
Returns a Rational whose value is the absolute value of this Rational. |
Rational
|
add(Rational other)
Returns a Rational whose value is the sum of this and other. |
Rational
|
divide(Rational other)
Returns a Rational whose value is the quotient of this and other. |
boolean
|
equals(java.lang.Object other)
Compares this rational to the other one |
java.lang.String
|
toString()
Returns a String representing this Rational as a reduced fraction numerator/denominator. |
Methods inherited from interface java.lang.Comparable |
---|
compareTo
|
Method Detail |
---|
Rational abs()
Rational add(Rational other)
other
- the other rational number to be added to this one.
Rational divide(Rational other)
other
- the rational number by which to divide this one
boolean equals(java.lang.Object other)
equals
in class java.lang.Object
other
- the rational number to which this should be compared
java.lang.String toString()
toString
in class java.lang.Object