public final class Rational extends java.lang.Number implements java.lang.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 and Description |
|---|
Rational(long pNumber)
Deprecated.
|
Rational(long pNumerator,
long pDenominator)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
byte |
byteValue()
Deprecated.
|
int |
compareTo(Rational pOther)
Deprecated.
|
long |
denominator()
Deprecated.
|
double |
doubleValue()
Deprecated.
|
boolean |
equals(java.lang.Object pOther)
Deprecated.
|
float |
floatValue()
Deprecated.
|
int |
hashCode()
Deprecated.
|
int |
intValue()
Deprecated.
|
long |
longValue()
Deprecated.
|
long |
numerator()
Deprecated.
|
short |
shortValue()
Deprecated.
|
java.lang.String |
toString()
Deprecated.
|
public Rational(long pNumber)
public Rational(long pNumerator,
long pDenominator)
public long numerator()
public long denominator()
public byte byteValue()
byteValue in class java.lang.Numberpublic short shortValue()
shortValue in class java.lang.Numberpublic int intValue()
intValue in class java.lang.Numberpublic long longValue()
longValue in class java.lang.Numberpublic float floatValue()
floatValue in class java.lang.Numberpublic double doubleValue()
doubleValue in class java.lang.Numberpublic int compareTo(Rational pOther)
compareTo in interface java.lang.Comparable<Rational>public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object pOther)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2018. All Rights Reserved.