Package com.tangosol.io.pof
Class RawQuad
java.lang.Object
java.lang.Number
com.tangosol.io.pof.RawQuad
- All Implemented Interfaces:
Serializable
An immutable POF 128-bit float.
- Since:
- Coherence 3.2
- Author:
- cp 2006.07.17
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionRawQuad
(double dfl) Construct a RawQuad from a double.Construct a RawQuad from the raw binary data.RawQuad
(BigInteger nUnscaledValue, int nScale) Construct a RawQuad from an unscaled integer value and a scale. -
Method Summary
Modifier and TypeMethodDescriptiondouble
Returns the value of the specified number as adouble
.boolean
Compare this object with another for equality.float
Returns the value of the specified number as afloat
.getBits()
Obtain the raw binary form of the 128-bit float.int
hashCode()
Obtain the hashcode for this object.int
intValue()
Returns the value of the specified number as anint
.long
Returns the value of the specified number as along
.int
scale()
Get the base-2 scale (exponent) of the quad value.toString()
Format this object's data as a human-readable string.Get the base-2 unscaled value (mantissa) of the quad value.Methods inherited from class java.lang.Number
byteValue, shortValue
-
Field Details
-
ZERO
An empty RawQuad value.
-
-
Constructor Details
-
RawQuad
Construct a RawQuad from the raw binary data.- Parameters:
binBits
- the raw binary form of the 128-bit float
-
RawQuad
public RawQuad(double dfl) Construct a RawQuad from a double.- Parameters:
dfl
- the double value
-
RawQuad
Construct a RawQuad from an unscaled integer value and a scale.- Parameters:
nUnscaledValue
- the unscaled value (mantissa)nScale
- the scale (exponent)
-
-
Method Details
-
intValue
public int intValue()Returns the value of the specified number as anint
. This may involve rounding or truncation. -
longValue
public long longValue()Returns the value of the specified number as along
. This may involve rounding or truncation. -
floatValue
public float floatValue()Returns the value of the specified number as afloat
. This may involve rounding.- Specified by:
floatValue
in classNumber
- Returns:
- the numeric value represented by this object after conversion
to type
float
.
-
doubleValue
public double doubleValue()Returns the value of the specified number as adouble
. This may involve rounding.- Specified by:
doubleValue
in classNumber
- Returns:
- the numeric value represented by this object after conversion
to type
double
.
-
getBits
Obtain the raw binary form of the 128-bit float.- Returns:
- a 16-byte binary
-
unscaledValue
Get the base-2 unscaled value (mantissa) of the quad value.The name of this method is based on Java's BigDecimal.
- Returns:
- an unscaled binary integer value of up to 113 binary digits
-
scale
public int scale()Get the base-2 scale (exponent) of the quad value.The name of this method is based on Java's BigDecimal.
- Returns:
- a binary exponent between -16382 to 16383 inclusive
-
equals
Compare this object with another for equality. -
hashCode
public int hashCode()Obtain the hashcode for this object. -
toString
Format this object's data as a human-readable string.
-