public abstract class RatNum extends RealNum
Constructor and Description |
---|
RatNum() |
Modifier and Type | Method and Description |
---|---|
static RatNum |
add(RatNum x,
RatNum y,
int k) |
static RatNum |
asRatNumOrNull(java.lang.Object value) |
int |
classifyFinite()
Check if value is finite, infinite, or NaN.
|
static int |
compare(RatNum x,
RatNum y) |
abstract IntNum |
denominator() |
static RatNum |
divide(RatNum x,
RatNum y) |
boolean |
equals(java.lang.Object obj) |
static boolean |
equals(RatNum x,
RatNum y) |
static RatNum |
infinity(int sign)
Return exact "rational" infinity.
|
boolean |
isExact() |
boolean |
isZero() |
static RatNum |
make(IntNum num,
IntNum den) |
static RatNum |
neg(RatNum x) |
abstract IntNum |
numerator() |
Numeric |
power(IntNum y)
Return this raised to an integer power.
|
static RealNum |
rationalize(RealNum x,
RealNum y)
Calcaulte the simplest rational between two reals.
|
RatNum |
rneg() |
static RatNum |
times(RatNum x,
RatNum y) |
RatNum |
toExact()
Convert to an exact number.
|
IntNum |
toExactInt(int rounding_mode)
Converts to an exact integer, with specified rounding mode.
|
RealNum |
toInt(int rounding_mode)
Converts a real to an integer, according to a specified rounding mode.
|
static RatNum |
valueOf(java.math.BigDecimal value) |
abs, add, add, angle, asBigDecimal, asRealNumOrNull, compareTo, conjugate, cos, div, divide, exp, im, isNegative, isReal, log, max, min, mul, re, sign, sin, sqrt, tan, times, toExactInt, toExactInt, toInexact, toInt, toScaledInt, toScaledInt, toScaledInt, toStringDecimal, toStringScientific, toStringScientific, toStringScientific, toStringScientific, unitQuaternion, unitVector, vectorPart
add, addReversed, colatitude, compare, compare, complexPart, divide, divReversed, equals, imMinusOne, imOne, jm, km, longitude, make, make, mulReversed, neg, neg, polar, polar, power, times, toString
add, compare, divide, doubleImagValue, doubleJmagValue, doubleKmagValue, doubleRealValue, doubleValue, equals, jmMinusOne, jmOne, kmMinusOne, kmOne, longValue, make, make, neg, number, polar, polar, power, times
add, compare, compareReversed, dimensions, divide, imValue, jmValue, kmValue, make, make, make, reValue, times, unit
public static final IntNum ten_exp_9
public abstract IntNum numerator()
public abstract IntNum denominator()
public int classifyFinite()
Complex
classifyFinite
in class RealNum
public static RatNum valueOf(java.math.BigDecimal value)
public static RatNum asRatNumOrNull(java.lang.Object value)
public static RatNum infinity(int sign)
sign
- either 1 or -1 for positive or negative infinitypublic Numeric power(IntNum y)
Numeric
y < 0
, returns div_inv of the result.public final RatNum toExact()
RealNum
inexact->exact
(for real numbers).public RealNum toInt(int rounding_mode)
RealNum
public IntNum toExactInt(int rounding_mode)
RealNum
toExactInt
in class RealNum