public class Float16 extends Object
The format is laid out as follows:
1 11111 1111111111
^ --^-- -----^----
sign | |_______ significand
|
-- exponent
Half-precision floating points can be useful to save memory and/or
bandwidth at the expense of range and precision when compared to single-precision
floating points (float32).
Ref: https://android.googlesource.com/platform/libcore/+/master/luni/src/main/java/libcore/util/FP16.java| Constructor and Description |
|---|
Float16() |
| Modifier and Type | Method and Description |
|---|---|
static int |
compare(short x,
short y)
Compares the two specified half-precision float values.
|
static boolean |
isNaN(short h)
Returns true if the specified half-precision float value represents
a Not-a-Number, false otherwise.
|
public static boolean isNaN(short h)
h - A half-precision float valuepublic static int compare(short x,
short y)
Compares the two specified half-precision float values. The following conditions apply during the comparison:
#POSITIVE_INFINITY)x - The first half-precision float value to compare.y - The second half-precision float value to compare0 if x is numerically equal to y, a
value less than 0 if x is numerically less than y,
and a value greater than 0 if x is numerically greater
than yCopyright © 2024 The Apache Software Foundation. All rights reserved.