public class Rational extends Number implements Comparable
Constructor and Description |
---|
Rational(BigInteger num) |
Rational(BigInteger num,
BigInteger den)
Rationals will always be represented in most reduced
form with a positive denominator.
|
Modifier and Type | Method and Description |
---|---|
Rational |
add(Rational arg) |
int |
compareTo(Object arg) |
Rational |
div(Rational arg) |
double |
doubleValue() |
float |
floatValue() |
BigInteger |
getDenominator()
* Returns the bottom half of the rational.
|
BigInteger |
getNumerator()
Returns the top half of the rational.
|
int |
intValue() |
Rational |
inverse() |
long |
longValue() |
Rational |
mul(Rational arg) |
Rational |
negate() |
Rational |
pow(Rational arg) |
Rational |
sub(Rational arg) |
String |
toString() |
static Number |
valueOf(String s) |
byteValue, shortValue
public Rational(BigInteger num)
public Rational(BigInteger num, BigInteger den)
public float floatValue()
floatValue
in class Number
public double doubleValue()
doubleValue
in class Number
public Rational negate()
public Rational inverse()
public BigInteger getDenominator()
public BigInteger getNumerator()
public int compareTo(Object arg)
compareTo
in interface Comparable
Jas4pp 1.5 © Java Analysis Studio for Particle Physics