@Runtime public class Rational extends Number implements Comparable<Rational>
BigInteger
.
Modifier and Type | Field and Description |
---|---|
static Function<Rational,Rational> |
abs |
static BiFunction<Rational,Rational,Rational> |
add |
static GenMonoid<BigInteger,Rational> |
addition |
static BiFunction<Rational,Rational,Rational> |
divide |
static Function<Rational,Rational> |
inverse |
static GenMonoid<BigInteger,Rational> |
multiplication |
static BiFunction<Rational,Rational,Rational> |
multiply |
static Function<Rational,Rational> |
negate |
static Rational |
ONE |
static Rational |
ONE_HALF |
protected static Map<Integer,BigInteger> |
powerOfTen |
static BiFunction<Rational,Rational,Rational> |
subtract |
static Rational |
TWO |
static Rational |
ZERO |
public static final Rational ZERO
public static final Rational ONE
public static final Rational TWO
public static final Rational ONE_HALF
protected static final Map<Integer,BigInteger> powerOfTen
public static final BiFunction<Rational,Rational,Rational> add
public static final BiFunction<Rational,Rational,Rational> subtract
public static final BiFunction<Rational,Rational,Rational> multiply
public static final BiFunction<Rational,Rational,Rational> divide
public static final GenMonoid<BigInteger,Rational> addition
public static final GenMonoid<BigInteger,Rational> multiplication
public static final Rational valueOf(long n)
public final BigInteger getNumerator()
public final BigInteger getDenominator()
public final boolean isInteger()
public final boolean isZero()
public final boolean isOne()
public static final Rational valueOf(String n) throws NumberFormatException
NumberFormatException
public static final Rational valueOf(BigInteger n)
protected static BigInteger tenPower(int exp)
public static final Rational valueOf(BigDecimal n)
public static final Rational valueOf(long n, long d)
public static final Rational valueOf(BigInteger n, BigInteger d)
public BigInteger bigIntegerValue()
public short shortValue()
shortValue
in class Number
public int[] intValues()
public float floatValue()
floatValue
in class Number
public double doubleValue()
doubleValue
in class Number
public Rational negate()
public Rational inverse()
public Rational power(int n)
public int signum()
public Rational abs()
public int compareTo(Rational x)
compareTo
in interface Comparable<Rational>
see also the complete user documentation .