Int40

value class Int40(val value: Long) : Comparable<Int40>

A 40-bit representation of a (signed) Integer

Constructors

Link copied to clipboard
constructor(value: Long)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val value: Long

the Long value this Integer represents. Must be between Int40.MIN_VALUE and Int40.MAX_VALUE

Functions

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

Performs a bitwise AND operation between the two values.

Link copied to clipboard
open operator override fun compareTo(other: Int40): Int
Link copied to clipboard
fun Int40.copyIntoByteArray(array: ByteArray, offset: Int = 0, byteOrder: ByteOrder): ByteArray

Encodes this Int40 and copies it into a ByteArray at a given offset.

Link copied to clipboard
operator fun div(other: Int40): Int40
Link copied to clipboard

Checks whether the bit at index is set in this Int40

Link copied to clipboard
operator fun minus(other: Int40): Int40
Link copied to clipboard
infix fun Int40.or(other: Int40): Int40

Performs a bitwise OR operation between the two values.

Link copied to clipboard
operator fun plus(other: Int40): Int40
Link copied to clipboard
fun Int40.setBit(index: Number): Int40

Creates a Int40 that is equal to this Int40 except the bit at index is set

Link copied to clipboard
infix fun Int40.shl(bitCount: Int): Int40

Shifts this value left by the bitCount number of bits.

Link copied to clipboard
infix fun Int40.shr(bitCount: Int): Int40

Shifts this value right by the bitCount number of bits.

Link copied to clipboard
operator fun times(other: Int40): Int40
Link copied to clipboard

Encodes this Int40 into a ByteArray.

Link copied to clipboard

Converts this Int40 value to UInt40. If this value is positive, the resulting UInt40 value represents the same numerical value as this Int40. The resulting UInt40 value has the same binary representation as this Int40 value.