public class Float16 extends AbstractFloat implements ValueType
Represents a 16-bit IEEE 754 floating-point number.
Decimal literals with the h suffix and the special words nanh and infh have type Float16. nanh represents a quiet not-a-number value, while infh represents positive infinity; use -infh for negative infinity. The corresponding nan and inf words have type Double.
A NaN value is unordered: it is unequal to every value, including itself, and all <, <=, > and >= comparisons involving it return false.
value = 3.5h notANumber = nanh positiveInfinity = infh negativeInfinity = -infh assert type(value) == Float16 assert type(notANumber) == Float16 assert notANumber != notANumber assert notANumber is nanh assert positiveInfinity is infh assert negativeInfinity is -infh assert positiveInfinity > value assert negativeInfinity < value
| Modifier and Type | Member | Description |
|---|---|---|
| public native | Float16Float16() |
Builds the neutral Float16 value (0.0h). |
| public native | Float16 | Builds a Float16 from a Boolean value (false = 0.0h, true = 1.0h). |
| public native | Float16 | Builds a Float16 from a Unicode scalar value. |
| public native | Float16 | Builds a Float16 from a UTF-16 code-unit value. |
| public native | Float16 | Builds a Float16 from a Double value. |
| public native | Float16 | Builds a Float16 from a Float16 value. |
| public native | Float16 | Builds a Float16 from an Int value. |
| public native | Float16 | Builds a Float16 from a signed 64-bit integer. |
| public native | Float16Float16(value as String) throws ValueException |
Builds a Float16 from a textual representation. |
| public native | Float16 | Builds a Float16 from an unsigned 32-bit integer. |
| public native | Float16 | Builds a Float16 from an unsigned 64-bit integer. |
| Modifier and Type | Member | Description |
|---|---|---|
| public native override | toStringtoString() as String |
Converts this value to its textual representation. |
| public static | tryParse | Parses a Float16 value from text. |