Scoop API

scoop:scoop.core:0.1.0

Double

struct Double

source · line 259
public
public 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

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 toUShort

source · line 469
public
@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
public
@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.

function toShort

source · line 445
public
@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
public
@NoGC @Intrinsic("double_unary_plus")
    public override operator fun unaryPlus(): Double

Returns the same floating-point representation, preserving signed zero and NaN bits.

function toByte

source · line 439
public
@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
public
@NoGC @Intrinsic("double_compare_to")
    public override operator fun compareTo(other: Double): Long

Returns -1, 0, or 1 in numerical order, with all NaNs equal and after positive infinity; signed zeros compare equally.

function equals

source · line 394
public
@NoGC @Intrinsic("double_equals")
    public override operator fun equals(other: Double): Boolean

Compares numerical values, treating all NaNs as one equal class and both signed zeros as equal.

function toInt

source · line 451
public
@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
public
@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
public
@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
public
@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
public
@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 isInfinite

source · line 407
public
@NoGC @Intrinsic("double_is_infinite")
    public fun isInfinite(): Boolean

Returns true for positive or negative infinity.

function toFloat

source · line 488
public
@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
public
@NoGC @Intrinsic("double_times")
    public override operator fun times(other: Double): Double

Multiplies at the receiver's precision using IEEE rounding and non-finite results.

function toUInt

source · line 475
public
@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
public
@NoGC @Intrinsic("double_is_finite")
    public fun isFinite(): Boolean

Returns true for finite values, including subnormal values and both zeros.

function toString

source · line 502
public
public override fun toString(): String

Returns a locale-independent shortest round-tripping decimal representation, or the corresponding NaN/infinity spelling.

function dec

source · line 355
public
@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
public
@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
public
@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 unaryMinus

source · line 343
public
@NoGC @Intrinsic("double_unary_minus")
    public override operator fun unaryMinus(): Double

Flips the sign bit, including for zero and NaN.

function toBits

source · line 329
public
@NoGC
    public fun toBits(): Long

Returns the raw representation bits, preserving signed zeros and NaN payloads.

function rem

source · line 387
public
@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.