public class Rational
extends java.lang.Object
构造器和说明 |
---|
Rational(long nominator,
long denominator)
Create a Rational with a given numerator and denominator.
|
Rational(Rational r)
Create a copy of a Rational.
|
限定符和类型 | 方法和说明 |
---|---|
boolean |
equals(java.lang.Object obj) |
long |
getDenominator()
Gets the denominator of the rational
|
long |
getNumerator()
Gets the numerator of the rational.
|
double |
toDouble()
Gets the rational value as type double.
|
java.lang.String |
toString() |
public Rational(long nominator, long denominator)
nominator
- denominator
- public Rational(Rational r)
public long getNumerator()
public long getDenominator()
public double toDouble()
public boolean equals(java.lang.Object obj)
equals
在类中 java.lang.Object
public java.lang.String toString()
toString
在类中 java.lang.Object