struct UInt8
source · line 7public struct UInt8 : Add<UInt8, UInt8>, Sub<UInt8, UInt8>, Mul<UInt8, UInt8>, Div<UInt8, UInt8>, Rem<UInt8, UInt8>, UnaryPlus<UInt8>, UnaryMinus<UInt8>, Increment<UInt8>, Decrement<UInt8>, Compare<UInt8>, RangeTo<UInt8, UIntRange>, RangeUntil<UInt8, UIntRange>, Equals<UInt8>, ToString, Hash
- Supertype
Add<UInt8, UInt8> - Supertype
Sub<UInt8, UInt8> - Supertype
Mul<UInt8, UInt8> - Supertype
Div<UInt8, UInt8> - Supertype
Rem<UInt8, UInt8> - Supertype
UnaryPlus<UInt8> - Supertype
UnaryMinus<UInt8> - Supertype
Increment<UInt8> - Supertype
Decrement<UInt8> - Supertype
Compare<UInt8> - Supertype
RangeTo<UInt8, UIntRange> - Supertype
RangeUntil<UInt8, UIntRange> - Supertype
Equals<UInt8> - Supertype
ToString - Supertype
Hash
A 8-bit unsigned integer. Arithmetic wraps modulo 2^8; division by zero throws ArithmeticException. Conversions are explicit and preserve the language's fixed-width rules on every target.
Extensions
public fun UByte.toBigInteger(): BigInteger· scoop:scoop.math:0.1.0public fun UByte.toBigDecimal(): BigDecimal· scoop:scoop.math:0.1.0public fun UInt8.toString(radix: Int): String· scoop:scoop.std:0.1.0
function compareTo
source · line 106@NoGC
@Intrinsic("uint8_compare_to")
public override operator fun compareTo(other: UInt8): Long
- Overrides
compareTo· Compare
Returns -1, 0, or 1 using unsigned mathematical ordering.
parameter other
source · line 108other: UInt8
function plus
source · line 72@NoGC
@Intrinsic("uint8_add")
public override operator fun plus(other: UInt8): UInt8
- Overrides
plus· Add
Returns the sum modulo 2^8; overflow does not throw.
parameter other
source · line 74other: UInt8
function rangeTo
source · line 219public override operator fun rangeTo(endpoint: UInt8): UIntRange
- Overrides
rangeTo· RangeTo
Creates an ascending range including both this value and the endpoint.
parameter endpoint
source · line 219endpoint: UInt8
function toULong
source · line 212@NoGC
@Intrinsic("uint8_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 toString
source · line 243public override fun toString(): String
- Overrides
toString· ToString
Returns the locale-independent decimal representation of this integer.
function times
source · line 86@NoGC
@Intrinsic("uint8_mul")
public override operator fun times(other: UInt8): UInt8
- Overrides
times· Mul
Returns the product modulo 2^8; overflow does not throw.
parameter other
source · line 88other: UInt8
function toFloat
source · line 24@NoGC @Intrinsic("uint8_to_float")
public fun toFloat(): Float
Rounds the integer directly to IEEE binary32 using round-to-nearest, ties-to-even.
function inv
source · line 134@NoGC
@Intrinsic("uint8_inv")
public fun inv(): UInt8
Flips all 8 bits of the representation.
function toInt
source · line 172@NoGC
@Intrinsic("uint8_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 div
source · line 93@Intrinsic("uint8_div")
public override operator fun div(other: UInt8): UInt8
- Overrides
div· Div
Returns the quotient truncated toward zero. A zero divisor throws ArithmeticException.
parameter other
source · line 94other: UInt8
function or
source · line 120@NoGC
@Intrinsic("uint8_or")
public infix fun or(other: UInt8): UInt8
Returns the bitwise union of the 8-bit operands.
parameter other
source · line 122other: UInt8
function minus
source · line 79@NoGC
@Intrinsic("uint8_sub")
public override operator fun minus(other: UInt8): UInt8
- Overrides
minus· Sub
Returns the difference modulo 2^8; overflow does not throw.
parameter other
source · line 81other: UInt8
function toUByte
source · line 188@NoGC
@Intrinsic("uint8_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 equals
source · line 36@NoGC
@Intrinsic("uint8_equals")
public override operator fun equals(other: UInt8): Boolean
- Overrides
equals· Equals
Compares the mathematical values of two integers of the same type.
parameter other
source · line 38other: UInt8
function inc
source · line 58@NoGC
@Intrinsic("uint8_inc")
public override operator fun inc(): UInt8
- Overrides
inc· Increment
Returns the value plus one, wrapping modulo 2^8.
function toLong
source · line 180@NoGC
@Intrinsic("uint8_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 hash
source · line 248public override fun hash(): Long
- Overrides
hash· Hash
Returns a hash consistent with same-type integer equality.
function dec
source · line 65@NoGC
@Intrinsic("uint8_dec")
public override operator fun dec(): UInt8
- Overrides
dec· Decrement
Returns the value minus one, wrapping modulo 2^8.
function shr
source · line 148@NoGC
@Intrinsic("uint8_shr")
public infix fun shr(count: Long): UInt8
Shifts right using the low 3 bits of the Long count, filling with zero bits.
parameter count
source · line 150count: Long
function unaryMinus
source · line 51@NoGC
@Intrinsic("uint8_unary_minus")
public override operator fun unaryMinus(): UInt8
- Overrides
unaryMinus· UnaryMinus
Returns the additive inverse modulo 2^8, including at the representation boundary.
function toShort
source · line 164@NoGC
@Intrinsic("uint8_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 downTo
source · line 237public infix fun downTo(endpoint: UInt8): UIntRange
Creates a descending range including both endpoints.
parameter endpoint
source · line 237endpoint: UInt8
function rem
source · line 100@Intrinsic("uint8_rem")
public override operator fun rem(other: UInt8): UInt8
- Overrides
rem· Rem
Returns the remainder associated with division truncated toward zero. A zero divisor throws ArithmeticException.
parameter other
source · line 101other: UInt8
function and
source · line 113@NoGC
@Intrinsic("uint8_and")
public infix fun and(other: UInt8): UInt8
Returns the bitwise intersection of the 8-bit operands.
parameter other
source · line 115other: UInt8
function toDouble
source · line 30@NoGC @Intrinsic("uint8_to_double")
public fun toDouble(): Double
Rounds the integer directly to IEEE binary64 using round-to-nearest, ties-to-even.
function xor
source · line 127@NoGC
@Intrinsic("uint8_xor")
public infix fun xor(other: UInt8): UInt8
Sets each result bit where the corresponding 8-bit operand bits differ.
parameter other
source · line 129other: UInt8
function toUShort
source · line 196@NoGC
@Intrinsic("uint8_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 rangeUntil
source · line 225public override operator fun rangeUntil(endpoint: UInt8): UIntRange
- Overrides
rangeUntil· RangeUntil
Creates an ascending range including this value and excluding the endpoint.
parameter endpoint
source · line 225endpoint: UInt8
function until
source · line 231public infix fun until(endpoint: UInt8): UIntRange
Creates an ascending range with an exclusive endpoint.
parameter endpoint
source · line 231endpoint: UInt8
function unaryPlus
source · line 44@NoGC
@Intrinsic("uint8_unary_plus")
public override operator fun unaryPlus(): UInt8
- Overrides
unaryPlus· UnaryPlus
Returns the unchanged integer value.
function toByte
source · line 156@NoGC
@Intrinsic("uint8_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 shl
source · line 141@NoGC
@Intrinsic("uint8_shl")
public infix fun shl(count: Long): UInt8
Shifts left using the low 3 bits of the Long count; shifted-out bits are discarded.
parameter count
source · line 143count: Long
function toUInt
source · line 204@NoGC
@Intrinsic("uint8_to_uint")
public fun toUInt(): UInt
Converts modulo 2^32 and interprets the result as a 32-bit unsigned integer. The conversion always succeeds.