Num
public class RationalBigInt extends java.lang.Object implements Num
For the ease of converting from the primitive data type double to BigFraction objects, copy by value semantic are is applied.
Modifier and Type | Field | Description |
---|---|---|
private Num |
EPSILON |
|
private static org.apache.commons.math3.fraction.BigFraction |
EPSILON_BIGFRACTION |
|
private static RationalBigInt |
instance |
|
private Num |
NaN |
|
private Num |
NEGATIVE_INFINITY |
|
private Num |
POSITIVE_INFINITY |
|
private org.apache.commons.math3.fraction.BigFraction |
value |
|
private Num |
ZERO |
Modifier | Constructor | Description |
---|---|---|
private |
RationalBigInt() |
|
private |
RationalBigInt(double value) |
|
private |
RationalBigInt(int num) |
|
private |
RationalBigInt(int num,
int den) |
|
private |
RationalBigInt(RationalBigInt num) |
|
private |
RationalBigInt(java.math.BigInteger num,
java.math.BigInteger den) |
|
private |
RationalBigInt(org.apache.commons.math3.fraction.BigFraction 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(RationalBigInt num) |
|
boolean |
equals(java.lang.Object obj) |
|
boolean |
eqZero() |
|
boolean |
geq(Num num) |
|
boolean |
geqZero() |
|
Num |
getEpsilon() |
|
static RationalBigInt |
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.BigFraction EPSILON_BIGFRACTION
private static RationalBigInt instance
private org.apache.commons.math3.fraction.BigFraction value
private Num POSITIVE_INFINITY
private Num NEGATIVE_INFINITY
private Num NaN
private Num ZERO
private Num EPSILON
private RationalBigInt()
private RationalBigInt(int num)
private RationalBigInt(double value)
private RationalBigInt(int num, int den)
private RationalBigInt(java.math.BigInteger num, java.math.BigInteger den)
private RationalBigInt(RationalBigInt num)
private RationalBigInt(org.apache.commons.math3.fraction.BigFraction frac)
public static RationalBigInt getInstance()
public boolean isInfinite()
isInfinite
in interface Num
public double doubleValue()
doubleValue
in interface Num
public boolean equals(RationalBigInt 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