Serializable, Comparable<Rational>public final class Rational extends Number implements Comparable<Rational>
long numerator and long denominator.
Rational numbers are stored in reduced form with the sign stored with the numerator.
Rationals are immutable.| Constructor | Description |
|---|---|
Rational(long pNumber) |
Deprecated.
|
Rational(long pNumerator,
long pDenominator) |
Deprecated.
|
| Modifier and Type | Method | Description |
|---|---|---|
byte |
byteValue() |
Deprecated.
|
int |
compareTo(Rational pOther) |
Deprecated.
|
long |
denominator() |
Deprecated.
|
double |
doubleValue() |
Deprecated.
|
boolean |
equals(Object pOther) |
Deprecated.
|
float |
floatValue() |
Deprecated.
|
int |
hashCode() |
Deprecated.
|
int |
intValue() |
Deprecated.
|
long |
longValue() |
Deprecated.
|
long |
numerator() |
Deprecated.
|
short |
shortValue() |
Deprecated.
|
String |
toString() |
Deprecated.
|
public Rational(long pNumber)
public Rational(long pNumerator,
long pDenominator)
public long numerator()
public long denominator()
public short shortValue()
shortValue in class Numberpublic float floatValue()
floatValue in class Numberpublic double doubleValue()
doubleValue in class Numberpublic int compareTo(Rational pOther)
compareTo in interface Comparable<Rational>Copyright © 2018. All rights reserved.