|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.Number
org.jscience.mathematics.algebraic.numbers.ComparableNumber<ExactInteger>
org.jscience.mathematics.algebraic.numbers.ExactInteger
public final class ExactInteger
The ExactInteger class encapsulates integer numbers with infinite precision but slower speed than Integer or Long.
IntegerRing,
Serialized Form| Field Summary | |
|---|---|
static ExactInteger |
NaN
|
static ExactInteger |
NEGATIVE_INFINITY
|
static ExactInteger |
ONE
The exact integer representing the multiplicative identity. |
static ExactInteger |
POSITIVE_INFINITY
|
static java.lang.Class |
TYPE
|
static ExactInteger |
ZERO
The exact integer representing the additive identity. |
| Constructor Summary | |
|---|---|
ExactInteger(java.math.BigInteger num)
Constructs a ExactInteger number. |
|
ExactInteger(ExactInteger num)
Constructs a ExactInteger number. |
|
ExactInteger(int num)
Constructs a ExactInteger number. |
|
ExactInteger(Integer num)
Constructs a ExactInteger number. |
|
ExactInteger(long num)
Constructs a ExactInteger number. |
|
ExactInteger(Long num)
Constructs a ExactInteger number. |
|
ExactInteger(java.lang.String s)
Constructs the ExactInteger number represented by a string. |
|
| Method Summary | |
|---|---|
ExactInteger |
abs()
Returns the abs of this number. |
AbelianGroup.Member |
add(AbelianGroup.Member n)
Returns the addition of this number and another. |
ExactInteger |
add(ExactInteger n)
Returns the addition of this ExactInteger number and another. |
java.lang.Object |
clone()
Returns the arc hyperbolic tangent of a number. |
int |
compareTo(ComparableNumber obj)
Compares two numbers. |
int |
compareTo(ExactInteger value)
Compares two ExactInteger numbers. |
double |
doubleValue()
|
boolean |
equals(java.lang.Object obj)
Compares two ExactInteger numbers for equality. |
float |
floatValue()
|
ExactInteger |
getDistance(ComparableNumber n)
DOCUMENT ME! |
ExactInteger |
getNaN()
DOCUMENT ME! |
ExactInteger |
getNegativeInfinity()
DOCUMENT ME! |
ExactInteger |
getPositiveInfinity()
DOCUMENT ME! |
int |
hashCode()
Returns the hashcode of this number. |
int |
intValue()
|
boolean |
isInfinite()
Returns true if this number is infinite. |
boolean |
isNaN()
Returns true if this number is NaN. |
boolean |
isNegativeInfinity()
DOCUMENT ME! |
boolean |
isPositiveInfinity()
DOCUMENT ME! |
long |
longValue()
|
ExactInteger |
max(ExactInteger val)
Returns the max of this number and another, according to compareTo rules. |
ExactInteger |
min(ExactInteger val)
Returns the min of this number and another, according to compareTo rules. |
ExactInteger |
multiply(ExactInteger n)
Returns the multiplication of this ExactInteger number and another. |
Ring.Member |
multiply(Ring.Member n)
Returns the multiplication of this number and another. |
AbelianGroup.Member |
negate()
Returns the negative of this number. |
ExactInteger |
pow(int i)
Returns this number raised to the power of a number. |
int |
signum()
Returns the sign of this number. |
AbelianGroup.Member |
subtract(AbelianGroup.Member n)
Returns the subtraction of this number and another. |
ExactInteger |
subtract(ExactInteger n)
Returns the subtraction of this ExactInteger number and another. |
java.lang.String |
toString()
Returns a string representing the value of this ExactInteger number. |
java.math.BigInteger |
value()
|
| Methods inherited from class java.lang.Number |
|---|
byteValue, shortValue |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final ExactInteger ZERO
public static final ExactInteger ONE
public static final ExactInteger NEGATIVE_INFINITY
public static final ExactInteger POSITIVE_INFINITY
public static final ExactInteger NaN
public static final java.lang.Class TYPE
| Constructor Detail |
|---|
public ExactInteger(ExactInteger num)
public ExactInteger(java.math.BigInteger num)
public ExactInteger(Long num)
public ExactInteger(Integer num)
public ExactInteger(long num)
public ExactInteger(int num)
public ExactInteger(java.lang.String s)
throws java.lang.NumberFormatException
s - a string representing a ExactInteger number.
java.lang.NumberFormatException - if the string does not contain a parsable number.| Method Detail |
|---|
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - a ExactInteger number.
public int compareTo(ComparableNumber obj)
throws java.lang.IllegalArgumentException
obj - a comparable number.
this<obj,
zero if this==obj,
and a positive value if this>obj.
java.lang.IllegalArgumentExceptionpublic int compareTo(ExactInteger value)
compareTo in interface java.lang.Comparable<ExactInteger>value - a ExactInteger number.
this<obj,
zero if this==obj,
and a positive value if this>obj.public java.lang.String toString()
toString in class java.lang.Objectpublic java.math.BigInteger value()
public int intValue()
intValue in class java.lang.Numberpublic long longValue()
longValue in class java.lang.Numberpublic float floatValue()
floatValue in class java.lang.Numberpublic double doubleValue()
doubleValue in class java.lang.Numberpublic ExactInteger abs()
public int signum()
public ExactInteger min(ExactInteger val)
min in class ComparableNumber<ExactInteger>val - DOCUMENT ME!
public ExactInteger max(ExactInteger val)
max in class ComparableNumber<ExactInteger>val - DOCUMENT ME!
public int hashCode()
hashCode in class java.lang.Objectpublic boolean isNaN()
isNaN in class ComparableNumber<ExactInteger>public boolean isInfinite()
isInfinite in class ComparableNumber<ExactInteger>public boolean isNegativeInfinity()
ComparableNumber
isNegativeInfinity in class ComparableNumber<ExactInteger>public boolean isPositiveInfinity()
ComparableNumber
isPositiveInfinity in class ComparableNumber<ExactInteger>public ExactInteger getNaN()
ComparableNumber
getNaN in class ComparableNumber<ExactInteger>public ExactInteger getNegativeInfinity()
ComparableNumber
getNegativeInfinity in class ComparableNumber<ExactInteger>public ExactInteger getPositiveInfinity()
ComparableNumber
getPositiveInfinity in class ComparableNumber<ExactInteger>public ExactInteger getDistance(ComparableNumber n)
ComparableNumber
getDistance in class ComparableNumber<ExactInteger>n - DOCUMENT ME!
public AbelianGroup.Member negate()
negate in interface AbelianGroup.Memberpublic AbelianGroup.Member add(AbelianGroup.Member n)
add in interface AbelianGroup.Membern - a group member
public ExactInteger add(ExactInteger n)
public AbelianGroup.Member subtract(AbelianGroup.Member n)
subtract in interface AbelianGroup.Membern - a group member
public ExactInteger subtract(ExactInteger n)
public Ring.Member multiply(Ring.Member n)
multiply in interface Ring.Membern - a ring member
public ExactInteger multiply(ExactInteger n)
public ExactInteger pow(int i)
public java.lang.Object clone()
clone in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||