UByte

An unsigned 8-bit integer with values from zero through 255.

Arithmetic uses unsigned ordering, division and remainder, with wrapping on overflow. Byte-sized and short-sized unsigned arithmetic produces UInt unless an operand is ULong. Integer conversions retain the destination's low bits; signed interpretations may change the value.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
infix external fun and(other: UByte): UByte

Returns the bitwise AND of this value and other.

Link copied to clipboard
open operator external override fun compareTo(other: UByte): Int
operator external fun compareTo(other: UInt): Int
operator external fun compareTo(other: ULong): Int
operator external fun compareTo(other: UShort): Int

Compares this value with other after numeric promotion.

Link copied to clipboard
operator external fun dec(): UByte

Returns this value minus one.

Link copied to clipboard
operator external fun div(other: UByte): UInt
operator external fun div(other: UInt): UInt
operator external fun div(other: ULong): ULong
operator external fun div(other: UShort): UInt

Divides this value by other.

Link copied to clipboard
infix fun UByte.downTo(other: UByte): UIntProgression
infix fun UByte.downTo(other: UInt): UIntProgression
infix fun UByte.downTo(other: ULong): ULongProgression
infix fun UByte.downTo(other: UShort): UIntProgression

Creates a descending progression from this value down to other, inclusive.

Link copied to clipboard
operator external fun inc(): UByte

Returns this value plus one.

Link copied to clipboard
external fun inv(): UByte

Inverts all 8 bits of this value.

Link copied to clipboard
operator external fun minus(other: UByte): UInt
operator external fun minus(other: UInt): UInt
operator external fun minus(other: ULong): ULong
operator external fun minus(other: UShort): UInt

Subtracts other from this value.

Link copied to clipboard
infix external fun or(other: UByte): UByte

Returns the bitwise OR of this value and other.

Link copied to clipboard
operator external fun plus(other: UByte): UInt
operator external fun plus(other: UInt): UInt
operator external fun plus(other: ULong): ULong
operator external fun plus(other: UShort): UInt

Adds other to this value.

Link copied to clipboard
operator fun UByte.rangeTo(other: UByte): UIntRange
operator fun UByte.rangeTo(other: UInt): UIntRange
operator fun UByte.rangeTo(other: ULong): ULongRange
operator fun UByte.rangeTo(other: UShort): UIntRange

Creates an ascending range from this value up to other, inclusive.

Link copied to clipboard
operator fun UByte.rangeUntil(other: UByte): UIntRange
operator fun UByte.rangeUntil(other: UInt): UIntRange
operator fun UByte.rangeUntil(other: ULong): ULongRange
operator fun UByte.rangeUntil(other: UShort): UIntRange

Creates an ascending range from this value up to other, exclusive.

Link copied to clipboard
operator external fun rem(other: UByte): UInt
operator external fun rem(other: UInt): UInt
operator external fun rem(other: ULong): ULong
operator external fun rem(other: UShort): UInt

Returns the remainder after dividing this value by other.

Link copied to clipboard
operator external fun times(other: UByte): UInt
operator external fun times(other: UInt): UInt
operator external fun times(other: ULong): ULong
operator external fun times(other: UShort): UInt

Multiplies this value by other.

Link copied to clipboard
external fun toByte(): Byte

Converts this value to Byte.

Link copied to clipboard
external fun toDouble(): Double

Converts this value to Double.

Link copied to clipboard
external fun toFloat(): Float

Converts this value to Float.

Link copied to clipboard
external fun toInt(): Int

Converts this value to Int.

Link copied to clipboard
external fun toLong(): Long

Converts this value to Long.

Link copied to clipboard
external fun toShort(): Short

Converts this value to Short.

Link copied to clipboard
external fun toUByte(): UByte

Returns this value unchanged.

Link copied to clipboard
external fun toUInt(): UInt

Converts this value to UInt.

Link copied to clipboard
external fun toULong(): ULong

Converts this value to ULong.

Link copied to clipboard
external fun toUShort(): UShort

Converts this value to UShort.

Link copied to clipboard
infix fun UByte.until(other: UByte): UIntRange
infix fun UByte.until(other: UInt): UIntRange
infix fun UByte.until(other: ULong): ULongRange
infix fun UByte.until(other: UShort): UIntRange

Creates an ascending range from this value up to other, exclusive.

Link copied to clipboard
infix external fun xor(other: UByte): UByte

Returns the bitwise exclusive OR of this value and other.