public interface ApfloatImpl extends Serializable
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.
| Modifier and Type | Method and Description |
|---|---|
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. |
ApfloatImpl |
frac()
Returns the fractional part of this
ApfloatImpl. |
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. |
long |
size()
Returns the size of the mantissa of this
ApfloatImpl. |
String |
toString(boolean pretty)
Convert this
ApfloatImpl to String. |
void |
writeTo(Writer out,
boolean pretty)
Print this
ApfloatImpl to a stream. |
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.ApfloatRuntimeExceptionApfloatImpl multiply(ApfloatImpl x) throws ApfloatRuntimeException
ApfloatImpl.x - The number to be multiplied by this ApfloatImpl.this * x.ApfloatRuntimeExceptionboolean 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.ApfloatRuntimeExceptionApfloat.isShort()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.ApfloatRuntimeExceptionApfloatImpl absFloor() throws ApfloatRuntimeException
ApfloatImpl rounded towards zero.ApfloatImpl rounded towards zero.ApfloatRuntimeExceptionApfloatImpl absCeil() throws ApfloatRuntimeException
ApfloatImpl rounded away from zero.ApfloatImpl rounded away from zero.ApfloatRuntimeExceptionApfloatImpl frac() throws ApfloatRuntimeException
ApfloatImpl.ApfloatImpl.ApfloatRuntimeExceptionint radix()
ApfloatImpl.ApfloatImpl.long precision()
ApfloatImpl.ApfloatImpl.long size() throws ApfloatRuntimeException
ApfloatImpl.ApfloatImpl.ApfloatRuntimeExceptionApfloatImpl precision(long precision) throws ApfloatRuntimeException
ApfloatImpl with the specified precision.precision - The precision.ApfloatImpl with the specified precision.ApfloatRuntimeExceptionlong scale()
throws ApfloatRuntimeException
ApfloatImpl.ApfloatImpl.ApfloatRuntimeExceptionApfloat.scale()int signum()
ApfloatImpl.ApfloatImpl.Apfloat.signum()ApfloatImpl negate() throws ApfloatRuntimeException
ApfloatImpl negated.-this.ApfloatRuntimeExceptiondouble 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.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.boolean isOne()
throws ApfloatRuntimeException
true if this number is equal to one, otherwise false.ApfloatRuntimeExceptionlong equalDigits(ApfloatImpl x) throws ApfloatRuntimeException
ApfloatImpl and another number.x - The number to compare with.ApfloatImpl and x.ApfloatRuntimeExceptionApfloat.equalDigits(org.apfloat.Apfloat)int compareTo(ApfloatImpl x) throws ApfloatRuntimeException
ApfloatImpl and another number.x - The number to compare with.ApfloatRuntimeExceptionApfloat.compareTo(org.apfloat.Apfloat)int hashCode()
ApfloatImpl.String toString(boolean pretty) throws ApfloatRuntimeException
ApfloatImpl to String.pretty - Flag for formatting.ApfloatImpl.ApfloatRuntimeExceptionApfloat.toString(boolean)void writeTo(Writer out, boolean pretty) throws IOException, ApfloatRuntimeException
ApfloatImpl to a stream.out - The stream to write to.pretty - Flag for formatting.IOException - In case of I/O error writing to the stream.ApfloatRuntimeExceptionApfloat.writeTo(Writer,boolean)Copyright © 2024. All rights reserved.