Num
public class RationalInt extends java.lang.Object implements Num
For the ease of converting from the primitive data type double to Fraction objects, copy by value semantic are is applied.
Modifier and Type | Field | Description |
---|---|---|
private Num |
EPSILON |
|
private static org.apache.commons.math3.fraction.Fraction |
EPSILON_FRACTION |
|
private static RationalInt |
instance |
|
private Num |
NaN |
|
private Num |
NEGATIVE_INFINITY |
|
private Num |
POSITIVE_INFINITY |
|
private org.apache.commons.math3.fraction.Fraction |
value |
|
private Num |
ZERO |
Modifier | Constructor | Description |
---|---|---|
private |
RationalInt() |
|
|
RationalInt(double value) |
|
|
RationalInt(int num) |
|
|
RationalInt(int num,
int den) |
|
|
RationalInt(RationalInt num) |
|
private |
RationalInt(org.apache.commons.math3.fraction.Fraction frac) |
Modifier and Type | Method | Description |
---|---|---|
Num |
abs(Num num) |
|
Num |
add(Num num1,
Num num2) |
|
Num |
copy() |
|
Num |
create(double value) |
|
Num |
create(int num) |
|
Num |
create(int num,
int den) |
|
Num |
create(java.lang.String num_str) |
|
Num |
createEpsilon() |
|
Num |
createNaN() |
|
Num |
createNegativeInfinity() |
|
Num |
createPositiveInfinity() |
|
Num |
createZero() |
|
Num |
diff(Num num1,
Num num2) |
|
Num |
div(Num num1,
Num num2) |
|
double |
doubleValue() |
|
boolean |
eq(double num) |
|
boolean |
equals(RationalInt num) |
|
boolean |
equals(java.lang.Object obj) |
|
boolean |
eqZero() |
|
boolean |
geq(Num num) |
|
boolean |
geqZero() |
|
Num |
getEpsilon() |
|
static RationalInt |
getInstance() |
|
Num |
getNaN() |
|
Num |
getNegativeInfinity() |
|
Num |
getPositiveInfinity() |
|
Num |
getZero() |
|
boolean |
gt(Num num) |
|
boolean |
gtZero() |
|
int |
hashCode() |
|
boolean |
isFinite() |
|
boolean |
isFinite(Num num) |
|
boolean |
isInfinite() |
|
boolean |
isInfinite(Num num) |
|
boolean |
isNaN() |
|
boolean |
isNaN(Num num) |
|
boolean |
leq(Num num) |
|
boolean |
leqZero() |
|
boolean |
lt(Num num) |
|
boolean |
ltZero() |
|
Num |
max(Num num1,
Num num2) |
|
Num |
min(Num num1,
Num num2) |
|
Num |
mult(Num num1,
Num num2) |
|
Num |
negate(Num num) |
|
Num |
sub(Num num1,
Num num2) |
|
java.lang.String |
toString() |
getFactory, getUtils
private static final org.apache.commons.math3.fraction.Fraction EPSILON_FRACTION
private static RationalInt instance
private org.apache.commons.math3.fraction.Fraction value
private Num POSITIVE_INFINITY
private Num NEGATIVE_INFINITY
private Num NaN
private Num ZERO
private Num EPSILON
private RationalInt()
public RationalInt(int num)
public RationalInt(double value)
public RationalInt(int num, int den)
public RationalInt(RationalInt num)
private RationalInt(org.apache.commons.math3.fraction.Fraction frac)
public static RationalInt getInstance()
public boolean isInfinite()
isInfinite
in interface Num
public double doubleValue()
doubleValue
in interface Num
public boolean equals(RationalInt num)
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public Num getPositiveInfinity()
getPositiveInfinity
in interface Num
public Num createPositiveInfinity()
createPositiveInfinity
in interface Num
public Num getNegativeInfinity()
getNegativeInfinity
in interface Num
public Num createNegativeInfinity()
createNegativeInfinity
in interface Num
public Num createZero()
createZero
in interface Num
public Num getEpsilon()
getEpsilon
in interface Num
public Num createEpsilon()
createEpsilon
in interface Num
public Num create(java.lang.String num_str) throws java.lang.Exception
public boolean isInfinite(Num num)
isInfinite
in interface Num