struct Double
source · line 259public struct Double : Add<Double, Double>, Sub<Double, Double>, Mul<Double, Double>, Div<Double, Double>, Rem<Double, Double>, UnaryPlus<Double>, UnaryMinus<Double>, Increment<Double>, Decrement<Double>, Equals<Double>, Compare<Double>, ToString
- Supertype
Add<Double, Double> - Supertype
Sub<Double, Double> - Supertype
Mul<Double, Double> - Supertype
Div<Double, Double> - Supertype
Rem<Double, Double> - Supertype
UnaryPlus<Double> - Supertype
UnaryMinus<Double> - Supertype
Increment<Double> - Supertype
Decrement<Double> - Supertype
Equals<Double> - Supertype
Compare<Double> - Supertype
ToString
IEEE 754 binary64 floating-point values, including infinities, signed zero, and NaNs. Default equality treats all NaNs as equal and both zeros as equal; ieeeCompare provides unordered IEEE comparison. Arithmetic uses round-to-nearest, ties-to-even.
function plus
source · line 361@NoGC @Intrinsic("double_plus")
public override operator fun plus(other: Double): Double
- Overrides
plus· Add
Adds at the receiver's precision using IEEE rounding and non-finite results.
parameter other
source · line 362other: Double
function toUShort
source · line 469@NoGC @Intrinsic("double_to_uint16")
public fun toUShort(): UShort
Truncates toward zero and saturates to the 16-bit unsigned range. NaN becomes zero.
function div
source · line 380@NoGC @Intrinsic("double_div")
public override operator fun div(other: Double): Double
- Overrides
div· Div
Performs IEEE division; zero divisors produce infinity or NaN rather than an integer arithmetic exception.
parameter other
source · line 381other: Double
function toShort
source · line 445@NoGC @Intrinsic("double_to_int16")
public fun toShort(): Short
Truncates toward zero and saturates to the 16-bit signed range. NaN becomes zero.
function unaryPlus
source · line 337@NoGC @Intrinsic("double_unary_plus")
public override operator fun unaryPlus(): Double
- Overrides
unaryPlus· UnaryPlus
Returns the same floating-point representation, preserving signed zero and NaN bits.
function toByte
source · line 439@NoGC @Intrinsic("double_to_int8")
public fun toByte(): Byte
Truncates toward zero and saturates to the 8-bit signed range. NaN becomes zero.
function compareTo
source · line 420@NoGC @Intrinsic("double_compare_to")
public override operator fun compareTo(other: Double): Long
- Overrides
compareTo· Compare
Returns -1, 0, or 1 in numerical order, with all NaNs equal and after positive infinity; signed zeros compare equally.
parameter other
source · line 421other: Double
function equals
source · line 394@NoGC @Intrinsic("double_equals")
public override operator fun equals(other: Double): Boolean
- Overrides
equals· Equals
Compares numerical values, treating all NaNs as one equal class and both signed zeros as equal.
parameter other
source · line 395other: Double
function toInt
source · line 451@NoGC @Intrinsic("double_to_int")
public fun toInt(): Int
Truncates toward zero and saturates to the 32-bit signed range. NaN becomes zero.
function inc
source · line 349@NoGC @Intrinsic("double_inc")
public override operator fun inc(): Double
- Overrides
inc· Increment
Adds one at the receiver's floating-point precision.
function toLong
source · line 457@NoGC @Intrinsic("double_to_long")
public fun toLong(): Long
Truncates toward zero and saturates to the 64-bit signed range. NaN becomes zero.
function toUByte
source · line 463@NoGC @Intrinsic("double_to_uint8")
public fun toUByte(): UByte
Truncates toward zero and saturates to the 8-bit unsigned range. NaN becomes zero.
function isNaN
source · line 401@NoGC @Intrinsic("double_is_nan")
public fun isNaN(): Boolean
Tests whether the value has any NaN representation. Default self-inequality is not a NaN test.
function minus
source · line 367@NoGC @Intrinsic("double_minus")
public override operator fun minus(other: Double): Double
- Overrides
minus· Sub
Subtracts at the receiver's precision using IEEE rounding and non-finite results.
parameter other
source · line 368other: Double
function isInfinite
source · line 407@NoGC @Intrinsic("double_is_infinite")
public fun isInfinite(): Boolean
Returns true for positive or negative infinity.
function toFloat
source · line 488@NoGC @Intrinsic("double_to_float")
public fun toFloat(): Float
Converts to binary32 with nearest-even rounding. Overflow may produce infinity; a zero keeps its sign.
function times
source · line 373@NoGC @Intrinsic("double_times")
public override operator fun times(other: Double): Double
- Overrides
times· Mul
Multiplies at the receiver's precision using IEEE rounding and non-finite results.
parameter other
source · line 374other: Double
function toUInt
source · line 475@NoGC @Intrinsic("double_to_uint")
public fun toUInt(): UInt
Truncates toward zero and saturates to the 32-bit unsigned range. NaN becomes zero.
function isFinite
source · line 413@NoGC @Intrinsic("double_is_finite")
public fun isFinite(): Boolean
Returns true for finite values, including subnormal values and both zeros.
function toString
source · line 502public override fun toString(): String
- Overrides
toString· ToString
Returns a locale-independent shortest round-tripping decimal representation, or the corresponding NaN/infinity spelling.
function dec
source · line 355@NoGC @Intrinsic("double_dec")
public override operator fun dec(): Double
- Overrides
dec· Decrement
Subtracts one at the receiver's floating-point precision.
function toULong
source · line 481@NoGC @Intrinsic("double_to_ulong")
public fun toULong(): ULong
Truncates toward zero and saturates to the 64-bit unsigned range. NaN becomes zero.
function toDouble
source · line 495@NoGC @Intrinsic("double_to_double")
public fun toDouble(): Double
Converts to binary64. Every finite Float value is represented exactly; a zero keeps its sign.
function ieeeCompare
source · line 427@NoGC
public fun ieeeCompare(other: Double): IeeeComparison
Returns IeeeComparison.Unordered if either operand is NaN; otherwise compares numerical values with both zeros equal.
parameter other
source · line 428other: Double
function unaryMinus
source · line 343@NoGC @Intrinsic("double_unary_minus")
public override operator fun unaryMinus(): Double
- Overrides
unaryMinus· UnaryMinus
Flips the sign bit, including for zero and NaN.
function toBits
source · line 329@NoGC
public fun toBits(): Long
Returns the raw representation bits, preserving signed zeros and NaN payloads.
function rem
source · line 387@NoGC @Intrinsic("double_rem")
public override operator fun rem(other: Double): Double
- Overrides
rem· Rem
Computes the remainder using a quotient truncated toward zero. Invalid operations produce NaN.
parameter other
source · line 388other: Double