Byte

A signed 8-bit integer with values from -128 through 127.

Arithmetic with Byte, Short or Int operands produces Int; wider operands determine the result type shown in the signature. inc, dec and conversion back to Byte wrap to 8 bits. Bitwise extensions are available in kotlin.experimental.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
infix fun Byte.and(other: Byte): Byte

Returns the bitwise AND of this value and other.

Link copied to clipboard
open operator external override fun compareTo(other: Byte): Int
operator external fun compareTo(other: Double): Int
operator external fun compareTo(other: Float): Int
operator external fun compareTo(other: Int): Int
operator external fun compareTo(other: Long): Int
operator external fun compareTo(other: Short): Int

Compares this value with other after numeric promotion.

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

Returns this value minus one.

Link copied to clipboard
operator external fun div(other: Byte): Int
operator external fun div(other: Double): Double
operator external fun div(other: Float): Float
operator external fun div(other: Int): Int
operator external fun div(other: Long): Long
operator external fun div(other: Short): Int

Divides this value by other.

Link copied to clipboard
infix fun Byte.downTo(other: Byte): IntProgression
infix fun Byte.downTo(other: Int): IntProgression
infix fun Byte.downTo(other: Long): LongProgression
infix fun Byte.downTo(other: Short): IntProgression

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

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

Returns this value plus one.

Link copied to clipboard
fun Byte.inv(): Byte

Inverts all 8 bits of this value.

Link copied to clipboard
operator external fun minus(other: Byte): Int
operator external fun minus(other: Double): Double
operator external fun minus(other: Float): Float
operator external fun minus(other: Int): Int
operator external fun minus(other: Long): Long
operator external fun minus(other: Short): Int

Subtracts other from this value.

Link copied to clipboard
infix fun Byte.or(other: Byte): Byte

Returns the bitwise OR of this value and other.

Link copied to clipboard
operator external fun plus(other: Byte): Int
operator external fun plus(other: Double): Double
operator external fun plus(other: Float): Float
operator external fun plus(other: Int): Int
operator external fun plus(other: Long): Long
operator external fun plus(other: Short): Int

Adds other to this value.

Link copied to clipboard
operator fun Byte.rangeTo(other: Byte): IntRange
operator fun Byte.rangeTo(other: Int): IntRange
operator fun Byte.rangeTo(other: Long): LongRange
operator fun Byte.rangeTo(other: Short): IntRange

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

Link copied to clipboard
operator fun Byte.rangeUntil(other: Byte): IntRange
operator fun Byte.rangeUntil(other: Int): IntRange
operator fun Byte.rangeUntil(other: Long): LongRange
operator fun Byte.rangeUntil(other: Short): IntRange

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

Link copied to clipboard
operator external fun rem(other: Byte): Int
operator external fun rem(other: Double): Double
operator external fun rem(other: Float): Float
operator external fun rem(other: Int): Int
operator external fun rem(other: Long): Long
operator external fun rem(other: Short): Int

Returns the remainder after dividing this value by other.

Link copied to clipboard
operator external fun times(other: Byte): Int
operator external fun times(other: Double): Double
operator external fun times(other: Float): Float
operator external fun times(other: Int): Int
operator external fun times(other: Long): Long
operator external fun times(other: Short): Int

Multiplies this value by other.

Link copied to clipboard
external fun toByte(): Byte

Returns this value unchanged.

Link copied to clipboard
external fun toChar(): Char

Converts this value to a UTF-16 code unit using its lowest 16 integer bits.

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

Converts this value to UByte.

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
operator external fun unaryMinus(): Int

Returns the negation of this value.

Link copied to clipboard
operator external fun unaryPlus(): Int

Returns this value with the type shown in the signature.

Link copied to clipboard
infix fun Byte.until(other: Byte): IntRange
infix fun Byte.until(other: Int): IntRange
infix fun Byte.until(other: Long): LongRange
infix fun Byte.until(other: Short): IntRange

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

Link copied to clipboard
infix fun Byte.xor(other: Byte): Byte

Returns the bitwise exclusive OR of this value and other.