Scoop API

scoop:scoop.core:0.1.0

UInt

struct UInt

source · line 7
public
public struct UInt : Add<UInt, UInt>, Sub<UInt, UInt>, Mul<UInt, UInt>, Div<UInt, UInt>, Rem<UInt, UInt>, UnaryPlus<UInt>, UnaryMinus<UInt>, Increment<UInt>, Decrement<UInt>, Compare<UInt>, RangeTo<UInt, UIntRange>, RangeUntil<UInt, UIntRange>, Equals<UInt>, ToString, Hash

A 32-bit unsigned integer. Arithmetic wraps modulo 2^32; division by zero throws ArithmeticException. Conversions are explicit and preserve the language's fixed-width rules on every target.

Extensions

function toDouble

source · line 30
public
@NoGC @Intrinsic("uint_to_double")
    public fun toDouble(): Double

Rounds the integer directly to IEEE binary64 using round-to-nearest, ties-to-even.

function toUInt

source · line 204
public
@NoGC
    @Intrinsic("uint_to_uint")
    public fun toUInt(): UInt

Converts modulo 2^32 and interprets the result as a 32-bit unsigned integer. The conversion always succeeds.

function toString

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

Returns the locale-independent decimal representation of this integer.

function toUShort

source · line 196
public
@NoGC
    @Intrinsic("uint_to_uint16")
    public fun toUShort(): UShort

Converts modulo 2^16 and interprets the result as a 16-bit unsigned integer. The conversion always succeeds.

function inc

source · line 58
public
@NoGC
    @Intrinsic("uint_inc")
    public override operator fun inc(): UInt
  • Overrides inc · Increment

Returns the value plus one, wrapping modulo 2^32.

function toLong

source · line 180
public
@NoGC
    @Intrinsic("uint_to_long")
    public fun toLong(): Long

Converts modulo 2^64 and interprets the result as a 64-bit signed integer. The conversion always succeeds.

function toFloat

source · line 24
public
@NoGC @Intrinsic("uint_to_float")
    public fun toFloat(): Float

Rounds the integer directly to IEEE binary32 using round-to-nearest, ties-to-even.

function shr

source · line 148
public
@NoGC
    @Intrinsic("uint_shr")
    public infix fun shr(count: Long): UInt

Shifts right using the low 5 bits of the Long count, filling with zero bits.

function unaryPlus

source · line 44
public
@NoGC
    @Intrinsic("uint_unary_plus")
    public override operator fun unaryPlus(): UInt

Returns the unchanged integer value.

function equals

source · line 36
public
@NoGC
    @Intrinsic("uint_equals")
    public override operator fun equals(other: UInt): Boolean

Compares the mathematical values of two integers of the same type.

function minus

source · line 79
public
@NoGC
    @Intrinsic("uint_sub")
    public override operator fun minus(other: UInt): UInt

Returns the difference modulo 2^32; overflow does not throw.

function toULong

source · line 212
public
@NoGC
    @Intrinsic("uint_to_ulong")
    public fun toULong(): ULong

Converts modulo 2^64 and interprets the result as a 64-bit unsigned integer. The conversion always succeeds.

function shl

source · line 141
public
@NoGC
    @Intrinsic("uint_shl")
    public infix fun shl(count: Long): UInt

Shifts left using the low 5 bits of the Long count; shifted-out bits are discarded.

function unaryMinus

source · line 51
public
@NoGC
    @Intrinsic("uint_unary_minus")
    public override operator fun unaryMinus(): UInt

Returns the additive inverse modulo 2^32, including at the representation boundary.

function toShort

source · line 164
public
@NoGC
    @Intrinsic("uint_to_int16")
    public fun toShort(): Short

Converts modulo 2^16 and interprets the result as a 16-bit signed integer. The conversion always succeeds.

function toInt

source · line 172
public
@NoGC
    @Intrinsic("uint_to_int")
    public fun toInt(): Int

Converts modulo 2^32 and interprets the result as a 32-bit signed integer. The conversion always succeeds.

function dec

source · line 65
public
@NoGC
    @Intrinsic("uint_dec")
    public override operator fun dec(): UInt
  • Overrides dec · Decrement

Returns the value minus one, wrapping modulo 2^32.

function plus

source · line 72
public
@NoGC
    @Intrinsic("uint_add")
    public override operator fun plus(other: UInt): UInt
  • Overrides plus · Add

Returns the sum modulo 2^32; overflow does not throw.

function inv

source · line 134
public
@NoGC
    @Intrinsic("uint_inv")
    public fun inv(): UInt

Flips all 32 bits of the representation.

function hash

source · line 248
public
public override fun hash(): Long
  • Overrides hash · Hash

Returns a hash consistent with same-type integer equality.

function toUByte

source · line 188
public
@NoGC
    @Intrinsic("uint_to_uint8")
    public fun toUByte(): UByte

Converts modulo 2^8 and interprets the result as a 8-bit unsigned integer. The conversion always succeeds.

function times

source · line 86
public
@NoGC
    @Intrinsic("uint_mul")
    public override operator fun times(other: UInt): UInt

Returns the product modulo 2^32; overflow does not throw.

function toByte

source · line 156
public
@NoGC
    @Intrinsic("uint_to_int8")
    public fun toByte(): Byte

Converts modulo 2^8 and interprets the result as a 8-bit signed integer. The conversion always succeeds.