public final class FpNumber
extends java.lang.Object
Constructor and Description |
---|
FpNumber(FpFormat format,
long bits)
Constructs a floating-point number.
|
FpNumber(FpFormat format,
long sign,
long exponent,
long fraction)
Constructs a floating-point number.
|
Modifier and Type | Method and Description |
---|---|
FpNumber |
clone() |
boolean |
equals(java.lang.Object o) |
long |
getBits()
Returns the bits representing of the floating-point number.
|
long |
getExponent()
Returns the exponent of the floating-point number.
|
FpFormat |
getFormat()
Returns the format of the floating-point number.
|
long |
getFraction()
Returns the fraction of the floating-point number.
|
long |
getSign()
Returns the sign of the floating-point number.
|
int |
hashCode() |
boolean |
isInfinity()
Checks whether the floating-point number is infinity.
|
boolean |
isMinusInfinity()
Checks whether the floating-point number is minus infinity.
|
boolean |
isMinusZero()
Checks whether the floating-point number is minus zero.
|
boolean |
isNaN()
Checks whether the floating-point number is non-a-number (NaN).
|
boolean |
isNormalized()
Checks whether the floating-point number is normalized.
|
boolean |
isPlusInfinity()
Checks whether the floating-point number is plus infinity.
|
boolean |
isPlusZero()
Checks whether the floating-point number is plus zero.
|
boolean |
isZero()
Checks whether the floating-point number is zero.
|
void |
setBits(long bits)
Sets the bits representation of the floating-point number.
|
void |
setExponent(long exponent)
Sets the exponent of the floating-point number.
|
void |
setFraction(long fraction)
Sets the fraction of the floating-point number.
|
void |
setSign(long sign)
Sets the sign of the floating-point number.
|
java.lang.String |
toString() |
public FpNumber(FpFormat format, long sign, long exponent, long fraction)
format
- the format.sign
- the sign.exponent
- the exponent.fraction
- the fraction.public FpNumber(FpFormat format, long bits)
format
- the format.bits
- the bits representing the number.public FpFormat getFormat()
public long getSign()
public long getExponent()
public long getFraction()
public void setSign(long sign)
sign
- the sign to be set.public void setExponent(long exponent)
exponent
- the exponent to be set.public void setFraction(long fraction)
fraction
- the fraction to be set.public long getBits()
public void setBits(long bits)
bits
- the bits to be set.public boolean isZero()
true
if the number is zero; false
otherwise.public boolean isPlusZero()
true
if the number is plus zero; false
otherwise.public boolean isMinusZero()
true
if the number is minus zero; false
otherwise.public boolean isInfinity()
true
if the number is infinity; false
otherwise.public boolean isPlusInfinity()
true
if the number is plus infinity; false
otherwise.public boolean isMinusInfinity()
true
if the number is minus infinity; false
otherwise.public boolean isNaN()
true
if the number is NaN; false
otherwise.public boolean isNormalized()
true
if the value is normalized; false
otherwise.public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public FpNumber clone()
clone
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object