Multiply a rational number times a long.
Multiply a rational number times a long.
multiply this times long l
Multiply two rational numbers (this * q).
Multiply two rational numbers (this * q).
multiply this times rational q
Add a rational number plus a long.
Add a rational number plus a long.
add long l to this
Add two rational numbers (this + q)
Add two rational numbers (this + q)
add rational q to this
Subtract: a rational number minus a long.
Subtract: a rational number minus a long.
subtract long l from this
Subtract two rational numbers (this - q).
Subtract two rational numbers (this - q).
subtract rational q from this
Divide a rational number div a long.
Divide a rational number div a long.
divide this by long l
Divide two rational numbers (this / q)
Divide two rational numbers (this / q)
divide this by rational q
Return the absolute value of this rational number.
Compare this rational number with that rational number q.
Compare this rational number with that rational number q.
that rational number
Compare two rational numbers (negative for <, zero for ==, positive for >).
Compare two rational numbers (negative for <, zero for ==, positive for >).
the first rational number to compare
the second rational number to compare
the denominator (e.
the denominator (e.g., 3)
Override equals to determine whether this rational number equals rational c.
Override equals to determine whether this rational number equals rational c.
the rational number to compare with this
Create a rational number from a BigDecimal number.
Create a rational number from a BigDecimal number.
the BigDecimal used to create the rational number
Create a rational number from a Double.
Create a rational number from a Double.
the Double used to create the rational number
Create a rational number from a Float.
Create a rational number from a Float.
the Float used to create the rational number
Create a rational number from an Int.
Create a rational number from an Int.
the Int used to create the rational number
Create a rational number from a Long.
Create a rational number from a Long.
the Long used to create the rational number
Must also override hashCode to be be compatible with equals.
Must also override hashCode to be be compatible with equals.
Determine whether this rational number is integral.
Return the maximum of this and that rational numbers.
Return the maximum of this and that rational numbers.
that rational number to compare with this
Return the minimum of this and that rational numbers.
Return the minimum of this and that rational numbers.
that rational number to compare with this
the numerator (e.
the numerator (e.g., 2)
Reduce the mangnitude of the numerator and denonimator by dividing both by their Greatest Common Divisor (GCD).
Return the square root of that rational number.
Convert that/this rational number to a BigDecimal number.
Convert that/this rational number to a BigDecimal number.
that rational number to convert
Convert that/this rational number to a Double.
Convert that/this rational number to a Double.
that rational number to convert
Convert that/this rational number to a Float.
Convert that/this rational number to a Float.
that rational number to convert
Convert that/this rational number to an Int.
Convert that/this rational number to an Int.
that rational number to convert
Convert this rational number to a Long.
Convert this rational number to a Long.
that rational number to convert
Convert this rational number to a String of the form 'a/b'.
Convert this rational number to a String of the form 'a/b'.
Convert this rational number to a String of the form '(a, b)'.
Compute the unary minus (-).
Raise a rational number to the l-th power.
Raise a rational number to the l-th power.
the long power/exponent
Raise a rational number to the q-th power.
Raise a rational number to the q-th power.
the rational power/exponent
The
Rational
class is used to represent and operate on rational numbers. Internally, a rational number is represented as two long integers. Externally, two forms are supported:a/b = 2/3 via: Rational ("2/3"), toString (a, b) = (2, 3) via: create ("(2, 3)") toString2
Rational number can be created without loss of precision using the constructor, apply, create or fromBigDecimal methods. Other methods may lose precision.
the numerator (e.g., 2)
the denominator (e.g., 3)