public final class Binary64 extends Object
Utility functions related to the binary64 format specified in
IEEE 754 2008.
| Modifier and Type | Method | Description |
|---|---|---|
static long |
unpackGetExponentUnbiased(double d) |
Extract and unbias the exponent of the given packed
double
value. |
static long |
unpackGetSign(double d) |
Retrieve the sign bit of the given floating point value, as an integer.
|
static long |
unpackGetSignificand(double d) |
Return the significand of the given floating point value as an integer.
|
public static long unpackGetExponentUnbiased(double d)
Extract and unbias the exponent of the given packed double
value.
The exponent is encoded biased as a number in the range
[0, 2047], with 0 indicating that the number is
subnormal and [1, 2046] denoting the actual exponent
plus BIAS. Infinite and NaN values always have a
biased exponent of 2047.
This function will therefore return:
0 - BIAS = -1023 iff the input is a
subnormal number.[1 - BIAS, 2046 - BIAS] = [-1022, 1023]
iff the input is a normal number.2047 - BIAS = 1024 iff the input is
Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY, or
NaN.d - A floating point valuepublic static long unpackGetSign(double d)
d - A floating point valuepublic static long unpackGetSignificand(double d)
Return the significand of the given floating point value as an integer.
d - A floating point valueBinary16.packSetSignificandUnchecked(int)Copyright © 2017 <code@io7m.com> http://io7m.com