Int48

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

A 48-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 Int48.MIN_VALUE and Int48.MAX_VALUE

Functions

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

Performs a bitwise AND operation between the two values.

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

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

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

Checks whether the bit at index is set in this Int48

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

Performs a bitwise OR operation between the two values.

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

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

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

Shifts this value left by the bitCount number of bits.

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

Shifts this value right by the bitCount number of bits.

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

Encodes this Int48 into a ByteArray.

Link copied to clipboard

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