Method Summary |
|
public Rational | abs() Returns the absolute value of this rational number. |
public int | compareTo(Rational that) Compares two rational number numerically.
Parameters: that - the rational number to compare with. |
public Rational | copy() |
public Rational | divide(Rational that) Returns this rational number divided by the one specified.
Parameters: that - the rational number divisor. |
public double | doubleValue() Returns the value of this rational number as a double . |
public boolean | equals(Object that) Compares this rational number against the specified object.
Parameters: that - the object to compare with. |
public LargeInteger | getDividend() Returns the smallest dividend of the fraction representing this
rational number. |
public LargeInteger | getDivisor() Returns the smallest divisor of the fraction representing this
rational (always positive). |
public int | hashCode() Returns the hash code for this rational number. |
public Rational | inverse() Returns the inverse of this rational number. |
public boolean | isLargerThan(Rational that) Compares the absolute value of two rational numbers.
Parameters: that - the rational number to be compared with. |
public boolean | isNegative() Indicates if this rational number is less than zero. |
public boolean | isPositive() Indicates if this rational number is greater than zero. |
public boolean | isZero() Indicates if this rational number is equal to zero. |
public long | longValue() Returns the value of this rational number as a long . |
public Rational | minus(Rational that) Returns the difference between this rational number and the one
specified.
Parameters: that - the rational number to be subtracted. |
public Rational | opposite() Returns the opposite of this rational number. |
public Rational | plus(Rational that) Returns the sum of this rational number with the one specified.
Parameters: that - the rational number to be added. |
public LargeInteger | round() Returns the closest integer value to this rational number. |
public Rational | times(long multiplier) Returns the product of this rational number with the specified
long multiplier.
Parameters: multiplier - the long multiplier. |
public Rational | times(Rational that) Returns the product of this rational number with the one specified.
Parameters: that - the rational number multiplier. |
public Text | toText() Returns the decimal text representation of this number. |
public static Rational | valueOf(long dividend, long divisor) Returns the rational number for the specified integer dividend and
divisor. |
public static Rational | valueOf(LargeInteger dividend, LargeInteger divisor) Returns the rational number for the specified large integer
dividend and divisor. |
public static Rational | valueOf(CharSequence chars) Returns the rational number for the specified character sequence.
Parameters: chars - the character sequence. |