Functions to convert values to/from the binary16 format
specified in IEEE 754 2008.
| Modifier and Type | Field and Description |
|---|---|
| public static final int | BIAS
The bias value used to offset the encoded exponent. |
| private static final int | |
| private static final int | |
| private static final int | |
| public static final char | NEGATIVE_INFINITY
The encoded form of negative infinity |
| public static final char | NEGATIVE_ZERO
The encoded form of negative zero |
| public static final char | POSITIVE_INFINITY
The encoded form of positive infinity |
| public static final char | POSITIVE_ZERO
The encoded form of positive zero |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static char | |
| public static boolean | |
| public static boolean | |
| public static char | packDouble(final double k)
Convert a double precision floating point value to a packed
|
| public static char | packFloat(final float k)
Convert a single precision floating point value to a packed
|
| public static char | |
| public static char | |
| public static char | |
| public static String | toRawBinaryString(final char k)
Show the given raw packed |
| public static double | unpackDouble(final char k)
Convert a packed |
| public static float | unpackFloat(final char k)
Convert a packed |
| public static int | unpackGetExponentUnbiased(final char k)
Extract and unbias the exponent of the given packed |
| public static int | unpackGetSign(final char k)
Retrieve the sign bit of the given packed |
| public static int | unpackGetSignificand(final char k)
Return the significand of the given packed |
| BIAS | back to summary |
|---|---|
| public static final int BIAS The bias value used to offset the encoded exponent. A given
exponent | |
| MASK_EXPONENT | back to summary |
|---|---|
| private static final int MASK_EXPONENT | |
| MASK_SIGN | back to summary |
|---|---|
| private static final int MASK_SIGN | |
| MASK_SIGNIFICAND | back to summary |
|---|---|
| private static final int MASK_SIGNIFICAND | |
| NEGATIVE_INFINITY | back to summary |
|---|---|
| public static final char NEGATIVE_INFINITY The encoded form of negative infinity | |
| NEGATIVE_ZERO | back to summary |
|---|---|
| public static final char NEGATIVE_ZERO The encoded form of negative zero | |
| POSITIVE_INFINITY | back to summary |
|---|---|
| public static final char POSITIVE_INFINITY The encoded form of positive infinity | |
| POSITIVE_ZERO | back to summary |
|---|---|
| public static final char POSITIVE_ZERO The encoded form of positive zero | |
| Binary16 | back to summary |
|---|---|
| private Binary16() | |
| exampleNaN | back to summary |
|---|---|
| public static char exampleNaN() One possible not-a-number value. | |
| isInfinite | back to summary |
|---|---|
| public static boolean isInfinite(final char k) Return | |
| isNaN | back to summary |
|---|---|
| public static boolean isNaN(final char k) Return | |
| packDouble | back to summary |
|---|---|
| public static char packDouble(final double k)
Convert a double precision floating point value to a packed
For the following specific cases, the function returns:
Otherwise, the
| |
| packFloat | back to summary |
|---|---|
| public static char packFloat(final float k)
Convert a single precision floating point value to a packed
For the following specific cases, the function returns:
Otherwise, the
| |
| packSetExponentUnbiasedUnchecked | back to summary |
|---|---|
| public static char packSetExponentUnbiasedUnchecked(final int e)
Encode the unbiased exponent
| |
| packSetSignificandUnchecked | back to summary |
|---|---|
| public static char packSetSignificandUnchecked(final int s)
Encode the significand
| |
| packSetSignUnchecked | back to summary |
|---|---|
| public static char packSetSignUnchecked(final int s)
Encode the sign bit
| |
| toRawBinaryString | back to summary |
|---|---|
| public static String toRawBinaryString(final char k) Show the given raw packed | |
| unpackDouble | back to summary |
|---|---|
| public static double unpackDouble(final char k)
Convert a packed The function returns:
| |
| unpackFloat | back to summary |
|---|---|
| public static float unpackFloat(final char k)
Convert a packed The function returns:
| |
| unpackGetExponentUnbiased | back to summary |
|---|---|
| public static int unpackGetExponentUnbiased(final char k)
Extract and unbias the exponent of the given packed
The exponent is encoded biased as a number in the range
This function will therefore return:
| |
| unpackGetSign | back to summary |
|---|---|
| public static int unpackGetSign(final char k) Retrieve the sign bit of the given packed
| |
| unpackGetSignificand | back to summary |
|---|---|
| public static int unpackGetSignificand(final char k)
Return the significand of the given packed | |