UInt40

value class UInt40(val value: ULong) : Comparable<UInt40>

A 40-bit representation of an (unsigned) Integer

Constructors

Link copied to clipboard
constructor(value: ULong)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

the ULong value this Integer represents. Must be between UInt40.MIN_VALUE and UInt40.MAX_VALUE

Functions

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

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

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

Checks whether the bit at index is set in this UInt40

Link copied to clipboard
operator fun minus(other: UInt40): UInt40
Link copied to clipboard
infix fun UInt40.or(other: UInt40): UInt40
Link copied to clipboard
operator fun plus(other: UInt40): UInt40
Link copied to clipboard
fun UInt40.setBit(index: Number): UInt40

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

Link copied to clipboard
infix fun UInt40.shl(bitCount: Int): UInt40
Link copied to clipboard
infix fun UInt40.shr(bitCount: Int): UInt40
Link copied to clipboard
operator fun times(other: UInt40): UInt40
Link copied to clipboard

Encodes this UInt40 into a ByteArray.

Link copied to clipboard

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