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