Package com.tangosol.io.pof
Class RawQuad
- java.lang.Object
-
- java.lang.Number
-
- com.tangosol.io.pof.RawQuad
-
- All Implemented Interfaces:
Serializable
public class RawQuad extends Number
An immutable POF 128-bit float.- Since:
- Coherence 3.2
- Author:
- cp 2006.07.17
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description RawQuad(double dfl)
Construct a RawQuad from a double.RawQuad(Binary binBits)
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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
doubleValue()
Returns the value of the specified number as adouble
.boolean
equals(Object o)
Compare this object with another for equality.float
floatValue()
Returns the value of the specified number as afloat
.Binary
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
longValue()
Returns the value of the specified number as along
.int
scale()
Get the base-2 scale (exponent) of the quad value.String
toString()
Format this object's data as a human-readable string.BigInteger
unscaledValue()
Get the base-2 unscaled value (mantissa) of the quad value.-
Methods inherited from class java.lang.Number
byteValue, shortValue
-
-
-
-
Field Detail
-
ZERO
public static final RawQuad ZERO
An empty RawQuad value.
-
-
Constructor Detail
-
RawQuad
public RawQuad(Binary binBits)
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
public RawQuad(BigInteger nUnscaledValue, int nScale)
Construct a RawQuad from an unscaled integer value and a scale.- Parameters:
nUnscaledValue
- the unscaled value (mantissa)nScale
- the scale (exponent)
-
-
Method Detail
-
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
public Binary getBits()
Obtain the raw binary form of the 128-bit float.- Returns:
- a 16-byte binary
-
unscaledValue
public BigInteger 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
public boolean equals(Object o)
Compare this object with another for equality.
-
hashCode
public int hashCode()
Obtain the hashcode for this object.
-
-