|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface for apfloat implementations. An ApfloatImpl
implements all of the
low-level functionality that is needed behind the high-level apfloat API.
A class implementing ApfloatImpl
is not required to accept any other ApfloatImpl
class as the argument than the same implementing class.
Method Summary | |
ApfloatImpl |
absCeil()
Returns this ApfloatImpl rounded away from zero. |
ApfloatImpl |
absFloor()
Returns this ApfloatImpl rounded towards zero. |
ApfloatImpl |
addOrSubtract(ApfloatImpl x,
boolean subtract)
Add or subtract an ApfloatImpl to this object. |
int |
compareTo(ApfloatImpl x)
Compare this ApfloatImpl and another number. |
ApfloatImpl |
divideShort(ApfloatImpl x)
Divide this ApfloatImpl by an ApfloatImpl that is "short". |
double |
doubleValue()
Returns the value of the this number as a double .
|
long |
equalDigits(ApfloatImpl x)
The number of equal digits in this ApfloatImpl and another number. |
int |
hashCode()
Returns the hash code for this ApfloatImpl . |
boolean |
isOne()
Tests if this number is equal to 1. |
boolean |
isShort()
Returns if this ApfloatImpl is "short". |
long |
longValue()
Returns the value of the this number as a long .
|
ApfloatImpl |
multiply(ApfloatImpl x)
Multiply this object by an ApfloatImpl . |
ApfloatImpl |
negate()
Returns this ApfloatImpl negated. |
long |
precision()
Returns the precision of this ApfloatImpl . |
ApfloatImpl |
precision(long precision)
Returns this ApfloatImpl with the specified precision. |
int |
radix()
Returns the radix of this ApfloatImpl . |
long |
scale()
Returns the scale of this ApfloatImpl . |
int |
signum()
Returns the signum of this ApfloatImpl . |
java.lang.String |
toString(boolean pretty)
Convert this ApfloatImpl to String . |
void |
writeTo(java.io.Writer out,
boolean pretty)
Print this ApfloatImpl to a stream. |
Method Detail |
public ApfloatImpl addOrSubtract(ApfloatImpl x, boolean subtract) throws ApfloatRuntimeException
ApfloatImpl
to this object.
x
- The number to be added or subtracted to this ApfloatImpl
.subtract
- true
if the numbers are to be subtracted, false
if added.
this + x
or this - x
depending on the subtract
argument.
ApfloatRuntimeException
public ApfloatImpl multiply(ApfloatImpl x) throws ApfloatRuntimeException
ApfloatImpl
.
x
- The number to be multiplied by this ApfloatImpl
.
this * x
.
ApfloatRuntimeException
public boolean isShort() throws ApfloatRuntimeException
ApfloatImpl
is "short". Typically ApfloatImpl
is "short" if its mantissa fits in one machine word. If the apfloat is "short",
some algorithms can be performed faster.The return value of this method is highly implementation dependent.
true
if the ApfloatImpl
is "short", false
if not.
ApfloatRuntimeException
Apfloat.isShort()
public ApfloatImpl divideShort(ApfloatImpl x) throws ApfloatRuntimeException
ApfloatImpl
by an ApfloatImpl
that is "short".
x
- The number by which this ApfloatImpl
is to be divided.
this / x
.
ApfloatRuntimeException
public ApfloatImpl absFloor() throws ApfloatRuntimeException
ApfloatImpl
rounded towards zero.
ApfloatImpl
rounded towards zero.
ApfloatRuntimeException
public ApfloatImpl absCeil() throws ApfloatRuntimeException
ApfloatImpl
rounded away from zero.
ApfloatImpl
rounded away from zero.
ApfloatRuntimeException
public int radix()
ApfloatImpl
.
ApfloatImpl
.public long precision()
ApfloatImpl
.
ApfloatImpl
.public ApfloatImpl precision(long precision) throws ApfloatRuntimeException
ApfloatImpl
with the specified precision.
precision
- The precision.
ApfloatImpl
with the specified precision.
ApfloatRuntimeException
public long scale() throws ApfloatRuntimeException
ApfloatImpl
.
ApfloatImpl
.
ApfloatRuntimeException
Apfloat.scale()
public int signum()
ApfloatImpl
.
ApfloatImpl
.Apfloat.signum()
public ApfloatImpl negate() throws ApfloatRuntimeException
ApfloatImpl
negated.
-this
.
ApfloatRuntimeException
public double doubleValue()
double
.
If the number is greater than Double.MAX_VALUE
,
then Double.POSITIVE_INFINITY
is returned.
If the number is less than Double.MIN_VALUE
,
then Double.NEGATIVE_INFINITY
is returned.
If the number is very small in magnitude, underflow may happen and zero is returned.
double
.public long longValue()
long
.
The fractional part is truncated towards zero.
If the number is greater than Long.MAX_VALUE
,
then Long.MAX_VALUE
is returned.
If the number is less than Long.MIN_VALUE
,
then Long.MIN_VALUE
is returned.
long
.public boolean isOne()
true
if this number is equal to one, otherwise false
.public long equalDigits(ApfloatImpl x) throws ApfloatRuntimeException
ApfloatImpl
and another number.
x
- The number to compare with.
ApfloatImpl
and x
.
ApfloatRuntimeException
Apfloat.equalDigits(Apfloat)
public int compareTo(ApfloatImpl x) throws ApfloatRuntimeException
ApfloatImpl
and another number.
x
- The number to compare with.
ApfloatRuntimeException
Apfloat.compareTo(Apfloat)
public int hashCode()
ApfloatImpl
.
ApfloatImpl
.public java.lang.String toString(boolean pretty) throws ApfloatRuntimeException
ApfloatImpl
to String
.
pretty
- Flag for formatting.
ApfloatImpl
.
ApfloatRuntimeException
Apfloat.toString(boolean)
public void writeTo(java.io.Writer out, boolean pretty) throws java.io.IOException, ApfloatRuntimeException
ApfloatImpl
to a stream.
out
- The stream to write to.pretty
- Flag for formatting.
java.io.IOException
- In case of I/O error writing to the stream.
ApfloatRuntimeException
Apfloat.writeTo(Writer,boolean)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |