PCast

object PCast(source)

Constants for casting operations. We cast constants on top of the stack. The stack is a stack of bytes. A cast operation takes the top n bytes and casts them to a different type.

Syntax of the cast byte: We can write the cast byte as 0xXY in hexadecimal where X is the type we cast from and Y is the type we cast to. It will be interpreted as follows: Read type X from the stack and cast it to type Y. Write the result back to the stack.

Cast operations will change the size of the stack (if the size of the type we cast to is different from the size of the type we cast from).

Get more information about the cast byte in the PCast Bytecode Specification

Since

0.1.0

Properties

Link copied to clipboard
const val BYTE: UByte

PCast constant for a byte

Link copied to clipboard
const val BYTE_TO_BYTE: UByte

Cast from a byte to a byte

Link copied to clipboard

Cast from a byte to a double

Link copied to clipboard
const val BYTE_TO_FLOAT: UByte

Cast from a byte to a float

Link copied to clipboard
const val BYTE_TO_INT: UByte

Cast from a byte to an int

Link copied to clipboard
const val BYTE_TO_LONG: UByte

Cast from a byte to a long

Link copied to clipboard
const val BYTE_TO_SHORT: UByte

Cast from a byte to a short

Link copied to clipboard
const val BYTE_TO_UBYTE: UByte

Cast from a byte to an unsigned byte

Link copied to clipboard
const val BYTE_TO_UINT: UByte

Cast from a byte to an unsigned int

Link copied to clipboard
const val BYTE_TO_ULONG: UByte

Cast from a byte to an unsigned long

Link copied to clipboard

Cast from a byte to an unsigned short

Link copied to clipboard
const val DOUBLE: UByte

PCast constant for a double

Link copied to clipboard

Cast from a double to a byte

Link copied to clipboard

Cast from a double to a double

Link copied to clipboard

Cast from a double to a float

Link copied to clipboard
const val DOUBLE_TO_INT: UByte

Cast from a double to an int

Link copied to clipboard

Cast from a double to a long

Link copied to clipboard

Cast from a double to a short

Link copied to clipboard

Cast from a double to an unsigned byte

Link copied to clipboard

Cast from a double to an unsigned int

Link copied to clipboard

Cast from a double to an unsigned long

Link copied to clipboard

Cast from a double to an unsigned short

Link copied to clipboard
const val FLOAT: UByte

PCast constant for a float

Link copied to clipboard
const val FLOAT_TO_BYTE: UByte

Cast from a float to a byte

Link copied to clipboard

Cast from a float to a double

Link copied to clipboard

Cast from a float to a float

Link copied to clipboard
const val FLOAT_TO_INT: UByte

Cast from a float to an int

Link copied to clipboard
const val FLOAT_TO_LONG: UByte

Cast from a float to a long

Link copied to clipboard

Cast from a float to a short

Link copied to clipboard

Cast from a float to an unsigned byte

Link copied to clipboard
const val FLOAT_TO_UINT: UByte

Cast from a float to an unsigned int

Link copied to clipboard

Cast from a float to an unsigned long

Link copied to clipboard

Cast from a float to an unsigned short

Link copied to clipboard
const val INT: UByte

PCast constant for an int

Link copied to clipboard
const val INT_TO_BYTE: UByte

Cast from an int to a byte

Link copied to clipboard
const val INT_TO_DOUBLE: UByte

Cast from an int to a double

Link copied to clipboard
const val INT_TO_FLOAT: UByte

Cast from an int to a float

Link copied to clipboard
const val INT_TO_INT: UByte

Cast from an int to an int

Link copied to clipboard
const val INT_TO_LONG: UByte

Cast from an int to a long

Link copied to clipboard
const val INT_TO_SHORT: UByte

Cast from an int to a short

Link copied to clipboard
const val INT_TO_UBYTE: UByte

Cast from an int to an unsigned byte

Link copied to clipboard
const val INT_TO_UINT: UByte

Cast from an int to an unsigned int

Link copied to clipboard
const val INT_TO_ULONG: UByte

Cast from an int to an unsigned long

Link copied to clipboard
const val INT_TO_USHORT: UByte

Cast from an int to an unsigned short

Link copied to clipboard
const val LONG: UByte

PCast constant for a long

Link copied to clipboard
const val LONG_TO_BYTE: UByte

Cast from a long to a byte

Link copied to clipboard

Cast from a long to a double

Link copied to clipboard
const val LONG_TO_FLOAT: UByte

Cast from a long to a float

Link copied to clipboard
const val LONG_TO_INT: UByte

Cast from a long to an int

Link copied to clipboard
const val LONG_TO_LONG: UByte

Cast from a long to a long

Link copied to clipboard
const val LONG_TO_SHORT: UByte

Cast from a long to a short

Link copied to clipboard
const val LONG_TO_UBYTE: UByte

Cast from a long to an unsigned byte

Link copied to clipboard
const val LONG_TO_UINT: UByte

Cast from a long to an unsigned int

Link copied to clipboard
const val LONG_TO_ULONG: UByte

Cast from a long to an unsigned long

Link copied to clipboard

Cast from a long to an unsigned short

Link copied to clipboard
const val SHORT: UByte

PCast constant for a short

Link copied to clipboard
const val SHORT_TO_BYTE: UByte

Cast from a short to a byte

Link copied to clipboard

Cast from a short to a double

Link copied to clipboard

Cast from a short to a float

Link copied to clipboard
const val SHORT_TO_INT: UByte

Cast from a short to an int

Link copied to clipboard
const val SHORT_TO_LONG: UByte

Cast from a short to a long

Link copied to clipboard

Cast from a short to a short

Link copied to clipboard

Cast from a short to an unsigned byte

Link copied to clipboard
const val SHORT_TO_UINT: UByte

Cast from a short to an unsigned int

Link copied to clipboard

Cast from a short to an unsigned long

Link copied to clipboard

Cast from a short to an unsigned short

Link copied to clipboard
const val UBYTE: UByte

PCast constant for an unsigned byte

Link copied to clipboard
const val UBYTE_TO_BYTE: UByte

Cast from an unsigned byte to a byte

Link copied to clipboard

Cast from an unsigned byte to a double

Link copied to clipboard

Cast from an unsigned byte to a float

Link copied to clipboard
const val UBYTE_TO_INT: UByte

Cast from an unsigned byte to an int

Link copied to clipboard
const val UBYTE_TO_LONG: UByte

Cast from an unsigned byte to a long

Link copied to clipboard

Cast from an unsigned byte to a short

Link copied to clipboard

Cast from an unsigned byte to an unsigned byte

Link copied to clipboard
const val UBYTE_TO_UINT: UByte

Cast from an unsigned byte to an unsigned int

Link copied to clipboard

Cast from an unsigned byte to an unsigned long

Link copied to clipboard

Cast from an unsigned byte to an unsigned short

Link copied to clipboard
const val UINT: UByte

PCast constant for an unsigned int

Link copied to clipboard
const val UINT_TO_BYTE: UByte

Cast from an unsigned int to a byte

Link copied to clipboard

Cast from an unsigned int to a double

Link copied to clipboard
const val UINT_TO_FLOAT: UByte

Cast from an unsigned int to a float

Link copied to clipboard
const val UINT_TO_INT: UByte

Cast from an unsigned int to an int

Link copied to clipboard
const val UINT_TO_LONG: UByte

Cast from an unsigned int to a long

Link copied to clipboard
const val UINT_TO_SHORT: UByte

Cast from an unsigned int to a short

Link copied to clipboard
const val UINT_TO_UBYTE: UByte

Cast from an unsigned int to an unsigned byte

Link copied to clipboard
const val UINT_TO_UINT: UByte

Cast from an unsigned int to an unsigned int

Link copied to clipboard
const val UINT_TO_ULONG: UByte

Cast from an unsigned int to an unsigned long

Link copied to clipboard

Cast from an unsigned int to an unsigned short

Link copied to clipboard
const val ULONG: UByte

PCast constant for an unsigned long

Link copied to clipboard
const val ULONG_TO_BYTE: UByte

Cast from an unsigned long to a byte

Link copied to clipboard

Cast from an unsigned long to a double

Link copied to clipboard

Cast from an unsigned long to a float

Link copied to clipboard
const val ULONG_TO_INT: UByte

Cast from an unsigned long to an int

Link copied to clipboard
const val ULONG_TO_LONG: UByte

Cast from an unsigned long to a long

Link copied to clipboard

Cast from an unsigned long to a short

Link copied to clipboard

Cast from an unsigned long to an unsigned byte

Link copied to clipboard
const val ULONG_TO_UINT: UByte

Cast from an unsigned long to an unsigned int

Link copied to clipboard

Cast from an unsigned long to an unsigned long

Link copied to clipboard

Cast from an unsigned long to an unsigned short

Link copied to clipboard
const val USHORT: UByte

PCast constant for an unsigned short

Link copied to clipboard

Cast from an unsigned short to a byte

Link copied to clipboard

Cast from an unsigned short to a double

Link copied to clipboard

Cast from an unsigned short to a float

Link copied to clipboard
const val USHORT_TO_INT: UByte

Cast from an unsigned short to an int

Link copied to clipboard

Cast from an unsigned short to a long

Link copied to clipboard

Cast from an unsigned short to a short

Link copied to clipboard

Cast from an unsigned short to an unsigned byte

Link copied to clipboard

Cast from an unsigned short to an unsigned int

Link copied to clipboard

Cast from an unsigned short to an unsigned long

Link copied to clipboard

Cast from an unsigned short to an unsigned short

Functions

Link copied to clipboard
@JvmName(name = "createByte")
fun create(from: Byte, to: Byte): UByte
fun create(from: UByte, to: UByte): UByte

Create shortcut for:

Link copied to clipboard
@JvmName(name = "invokeByte")
operator fun invoke(from: Byte, to: Byte): UByte
operator fun invoke(from: UByte, to: UByte): UByte

Invoke is a shortcut for: