Scoop API

scoop:scoop.core:0.1.0

Int16

struct Int16

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

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

Extensions

function hash

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

Returns a hash consistent with same-type integer equality.

function toUByte

source · line 196
public
@NoGC
    @Intrinsic("int16_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 toULong

source · line 220
public
@NoGC
    @Intrinsic("int16_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 toUInt

source · line 212
public
@NoGC
    @Intrinsic("int16_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 inv

source · line 135
public
@NoGC
    @Intrinsic("int16_inv")
    public fun inv(): Int16

Flips all 16 bits of the representation.

function toLong

source · line 188
public
@NoGC
    @Intrinsic("int16_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("int16_to_float")
    public fun toFloat(): Float

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

function toByte

source · line 164
public
@NoGC
    @Intrinsic("int16_to_int8")
    public fun toByte(): Byte

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

function toString

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

Returns the locale-independent decimal representation of this integer.

function toDouble

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

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

function toUShort

source · line 204
public
@NoGC
    @Intrinsic("int16_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 unaryMinus

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

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

function dec

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

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

function toInt

source · line 180
public
@NoGC
    @Intrinsic("int16_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 unaryPlus

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

Returns the unchanged integer value.

function toShort

source · line 172
public
@NoGC
    @Intrinsic("int16_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 shl

source · line 142
public
@NoGC
    @Intrinsic("int16_shl")
    public infix fun shl(count: Long): Int16

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

function inc

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

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