public class Float extends AbstractFloat implements ValueType:
Represents a 32-bit IEEE 754 floating-point number.
Decimal literals with the f suffix and the special words nanf and inff have type Float. nanf represents a quiet not-a-number value, while inff represents positive infinity; use -inff 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.5f notANumber = nanf positiveInfinity = inff negativeInfinity = -inff assert type(value) == Float assert type(notANumber) == Float assert notANumber != notANumber assert notANumber is nanf assert positiveInfinity is inff assert negativeInfinity is -inff assert positiveInfinity > value assert negativeInfinity < value
| Modifier and Type | Member | Description |
|---|---|---|
| public native | FloatFloat() |
Builds the neutral Float value (0.0f). |
| public native | Float | Builds a Float from a Unicode scalar value. |
| public native | Float | Builds a Float from a Boolean value (false = 0.0f, true = 1.0f). |
| public native | Float | Builds a Float from a UTF-16 code-unit value. |
| public native | Float | Builds a Float from a Double value. |
| public native | Float | Builds a Float from a Float value. |
| public native | Float | Builds a Float from an Int value. |
| public native | Float | Builds a Float from a signed 64-bit integer. |
| public native | FloatFloat(value: String) throws ValueException |
Builds a Float from a textual representation. |
| public native | Float | Builds a Float from an unsigned 32-bit integer. |
| public native | Float | Builds a Float from an unsigned 64-bit integer. |
| Modifier and Type | Member | Description |
|---|---|---|
| public override | toStringtoString() as String: |
Converts this value to its textual representation. |
| public static | tryParse | Parses a Float value from text. |