public class Double extends AbstractFloat implements ValueType:
Represents a 64-bit IEEE 754 floating-point number.
Double is the default floating-point type used by Klyn for decimal literals without the f suffix. It supports arithmetic, comparison and explicit conversions from the primitive scalar types. The special words nan and inf also have type Double: nan represents a quiet not-a-number value, inf positive infinity and -inf negative infinity. Use nanf and inff when the required type is Float.
A NaN value is unordered: it is unequal to every value, including itself, and all <, <=, > and >= comparisons involving it return false.
value = 3.5
other = Double("2.25")
notANumber = nan
positiveInfinity = inf
negativeInfinity = -inf
assert value + other == 5.75
assert type(notANumber) == Double
assert notANumber != notANumber
assert notANumber is nan
assert positiveInfinity is inf
assert negativeInfinity is -inf
assert positiveInfinity > value
assert negativeInfinity < value| Modifier and Type | Member | Description |
|---|---|---|
| public native | DoubleDouble() |
Builds the neutral Double value (0.0). |
| public native | Double | Builds a Double from a Unicode scalar value. |
| public native | Double | Builds a Double from a Boolean value. |
| public native | Double | Builds a Double from a UTF-16 code-unit value. |
| public native | Double | Copy constructor. |
| public native | Double | Builds a Double from a Float value. |
| public native | Double | Builds a Double from an Int value. |
| public native | Double | Builds a Double from a Long value. |
| public native | DoubleDouble(value: String) throws ValueException |
Parses a Double from a textual representation. |
| public native | Double | Builds a Double from a UInt value. |
| public native | Double | Builds a Double from a ULong value. |
| Modifier and Type | Member | Description |
|---|---|---|
| public override | toStringtoString() as String: |
Converts this value to its textual representation. |