Package-level declarations

Types

Link copied to clipboard
inline class Int64(val raw: Double) : Comparable<Int64>

Allocation-less Long implementation that uses a Double with reinterpreted values

Link copied to clipboard
inline class Int64Array(val raw: DoubleArray) : Iterable<Int64>
Link copied to clipboard
inline class IntMaskRange

Properties

Link copied to clipboard

Get high 32-bits of this Long

Link copied to clipboard

Get low 32-bits of this Long

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Get high 32-bits of this Long

Link copied to clipboard
expect val Double.highBits: Int
actual val Double.highBits: Int
actual val Double.highBits: Int
actual val Double.highBits: Int
actual val Double.highBits: Int
Link copied to clipboard
val Long.low: Int

Get low 32-bits of this Long

Link copied to clipboard
expect val Double.lowBits: Int
actual val Double.lowBits: Int
actual val Double.lowBits: Int
actual val Double.lowBits: Int
actual val Double.lowBits: Int
Link copied to clipboard

Functions

Link copied to clipboard
fun bit(bit: Int): Int

Creates an integer with only bit bit set

Link copied to clipboard
fun Int.clear(offset: Int, count: Int): Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun Int64Array.copyOf(newSize: Int = this.size): Int64Array
Link copied to clipboard
fun Int64Array.copyOfRange(fromIndex: Int, toIndex: Int): Int64Array
Link copied to clipboard

Returns the number of leading ones of the bits of this integer

Link copied to clipboard
inline fun Int.countLeadingZeros(): Int

Returns the number of leading zeros of the bits of this integer

Link copied to clipboard

Returns the number of trailing ones of the bits of this integer

Link copied to clipboard

Returns the number of trailing zeros of the bits of this integer

Link copied to clipboard
expect fun Double.equalsRaw(other: Double): Boolean

Bit-wise equals without considering NaNs

actual fun Double.equalsRaw(other: Double): Boolean

Bit-wise equals without considering NaNs

actual fun Double.equalsRaw(other: Double): Boolean

Bit-wise equals without considering NaNs

actual fun Double.equalsRaw(other: Double): Boolean

Bit-wise equals without considering NaNs

actual fun Double.equalsRaw(other: Double): Boolean

Bit-wise equals without considering NaNs

Link copied to clipboard
inline fun Int.extract(offset: Int): Boolean

Extracts a bits at offset from this (returning a Boolean)

fun Int.extract(offset: Int, count: Int): Int

Extracts count bits at offset from this

Link copied to clipboard
inline fun Int.extract1(offset: Int): Int

Extracts 1 bit at offset from this

Link copied to clipboard
inline fun Int.extract10(offset: Int): Int

Extracts 10 bits at offset from this

Link copied to clipboard
inline fun Int.extract11(offset: Int): Int

Extracts 11 bits at offset from this

Link copied to clipboard
inline fun Int.extract12(offset: Int): Int

Extracts 12 bits at offset from this

Link copied to clipboard
inline fun Int.extract13(offset: Int): Int

Extracts 13 bits at offset from this

Link copied to clipboard
inline fun Int.extract14(offset: Int): Int

Extracts 14 bits at offset from this

Link copied to clipboard
inline fun Int.extract15(offset: Int): Int

Extracts 15 bits at offset from this

Link copied to clipboard
inline fun Int.extract16(offset: Int): Int

Extracts 16 bits at offset from this

Link copied to clipboard
fun Int.extract16Signed(offset: Int): Int

Extracts 16 bits at offset from this sign-extending its result

Link copied to clipboard
inline fun Int.extract17(offset: Int): Int

Extracts 17 bits at offset from this

Link copied to clipboard
inline fun Int.extract18(offset: Int): Int

Extracts 18 bits at offset from this

Link copied to clipboard
inline fun Int.extract19(offset: Int): Int

Extracts 19 bits at offset from this

Link copied to clipboard
inline fun Int.extract2(offset: Int): Int

Extracts 2 bits at offset from this

Link copied to clipboard
inline fun Int.extract20(offset: Int): Int

Extracts 20 bits at offset from this

Link copied to clipboard
inline fun Int.extract21(offset: Int): Int

Extracts 21 bits at offset from this

Link copied to clipboard
inline fun Int.extract22(offset: Int): Int

Extracts 22 bits at offset from this

Link copied to clipboard
inline fun Int.extract23(offset: Int): Int

Extracts 23 bits at offset from this

Link copied to clipboard
inline fun Int.extract24(offset: Int): Int

Extracts 24 bits at offset from this

Link copied to clipboard
inline fun Int.extract25(offset: Int): Int

Extracts 25 bits at offset from this

Link copied to clipboard
inline fun Int.extract26(offset: Int): Int

Extracts 26 bits at offset from this

Link copied to clipboard
inline fun Int.extract27(offset: Int): Int

Extracts 27 bits at offset from this

Link copied to clipboard
inline fun Int.extract28(offset: Int): Int

Extracts 28 bits at offset from this

Link copied to clipboard
inline fun Int.extract29(offset: Int): Int

Extracts 29 bits at offset from this

Link copied to clipboard
inline fun Int.extract3(offset: Int): Int

Extracts 3 bits at offset from this

Link copied to clipboard
inline fun Int.extract30(offset: Int): Int

Extracts 30 bits at offset from this

Link copied to clipboard
inline fun Int.extract31(offset: Int): Int

Extracts 31 bits at offset from this

Link copied to clipboard
inline fun Int.extract32(offset: Int): Int

Extracts 32 bits at offset from this

Link copied to clipboard
inline fun Int.extract4(offset: Int): Int

Extracts 4 bits at offset from this

Link copied to clipboard
inline fun Int.extract5(offset: Int): Int

Extracts 5 bits at offset from this

Link copied to clipboard
inline fun Int.extract6(offset: Int): Int

Extracts 6 bits at offset from this

Link copied to clipboard
inline fun Int.extract7(offset: Int): Int

Extracts 7 bits at offset from this

Link copied to clipboard
inline fun Int.extract8(offset: Int): Int

Extracts 8 bits at offset from this

Link copied to clipboard
fun Int.extract8Signed(offset: Int): Int

Extracts 8 bits at offset from this sign-extending its result

Link copied to clipboard
inline fun Int.extract9(offset: Int): Int

Extracts 9 bits at offset from this

Link copied to clipboard
inline fun Int.extractBool(offset: Int): Boolean

Extracts a bits at offset from this (returning a Boolean)

Link copied to clipboard
fun Int.extractByte(offset: Int): Byte

Extracts 8 bits at offset from this as Byte

Link copied to clipboard
Link copied to clipboard
fun Int.extractScaled(offset: Int, count: Int, scale: Int): Int

Extracts count at offset from this and convert the possible values into the range 0x00..scale

Link copied to clipboard
fun Int.extractScaledf01(offset: Int, count: Int): Float

Extracts count at offset from this and convert the possible values into the range 0.0..1.0

Link copied to clipboard
fun Int.extractScaledFF(offset: Int, count: Int): Int

Extracts count at offset from this and convert the possible values into the range 0x00..0xFF

Link copied to clipboard
fun Int.extractScaledFFDefault(offset: Int, count: Int, default: Int): Int

Extracts count at offset from this and convert the possible values into the range 0x00..0xFF (if there are 0 bits, returns default)

Link copied to clipboard
fun Int.extractShort(offset: Int): Short

Extracts 16 bits at offset from this as Short

Link copied to clipboard
fun Int.extractSigned(offset: Int, count: Int): Int

Extracts count bits at offset from this sign-extending its result

fun Int.extractSigned(offset: Int, count: Int, signed: Boolean): Int

Extracts count bits at offset from this sign-extending its result if signed is set to true

Link copied to clipboard
inline fun Int.fastForEachOneBits(block: (Int) -> Unit)
Link copied to clipboard
fun Int.finsert(value: Boolean, offset: Int): Int

fun Int.finsert(value: Int, offset: Int): Int

Fast Insert: do not clear bits, assume affecting bits are 0

Link copied to clipboard
fun Int.finsert1(value: Int, offset: Int): Int
Link copied to clipboard
fun Int.finsert12(value: Int, offset: Int): Int
Link copied to clipboard
fun Int.finsert16(value: Int, offset: Int): Int
Link copied to clipboard
fun Int.finsert2(value: Int, offset: Int): Int
Link copied to clipboard
fun Int.finsert24(value: Int, offset: Int): Int
Link copied to clipboard
fun Int.finsert3(value: Int, offset: Int): Int
Link copied to clipboard
fun Int.finsert4(value: Int, offset: Int): Int
Link copied to clipboard
fun Int.finsert5(value: Int, offset: Int): Int
Link copied to clipboard
fun Int.finsert6(value: Int, offset: Int): Int
Link copied to clipboard
fun Int.finsert7(value: Int, offset: Int): Int
Link copied to clipboard
fun Int.finsert8(value: Int, offset: Int): Int
Link copied to clipboard
expect fun Double.Companion.fromLowHigh(low: Int, high: Int): Double
inline fun Long.Companion.fromLowHigh(low: Int, high: Int): Long
actual fun Double.Companion.fromLowHigh(low: Int, high: Int): Double
actual fun Double.Companion.fromLowHigh(low: Int, high: Int): Double
actual inline fun Double.Companion.fromLowHigh(low: Int, high: Int): Double
actual fun Double.Companion.fromLowHigh(low: Int, high: Int): Double
Link copied to clipboard
fun Double.Companion.fromParts(sign: Int, exponent: Int, mantissa: Double): Double
fun Double.Companion.fromParts(sign: Int, exponent: Int, mantissa: Long): Double
fun Double.Companion.fromParts(sign: Int, exponent: Int, mantissaLow: Int, mantissaHigh: Int): Double
Link copied to clipboard
expect inline fun <T> Double.getLowHighBits(block: (low: Int, high: Int) -> T): T
actual inline fun <T> Double.getLowHighBits(block: (low: Int, high: Int) -> T): T
actual inline fun <T> Double.getLowHighBits(block: (low: Int, high: Int) -> T): T
actual inline fun <T> Double.getLowHighBits(block: (low: Int, high: Int) -> T): T
actual inline fun <T> Double.getLowHighBits(block: (low: Int, high: Int) -> T): T
Link copied to clipboard
inline fun Int64Array.getOrElse(index: Int, defaultValue: (Int) -> Int64): Int64
Link copied to clipboard
Link copied to clipboard
infix fun Int.hasBits(bits: Int): Boolean
infix fun Long.hasBits(bits: Long): Boolean
Link copied to clipboard
infix fun Int.hasBitSet(index: Int): Boolean

Check if a specific bit at index is set

Link copied to clipboard
infix fun Int.hasFlags(bits: Int): Boolean

Check if this has all the bits set in bits set

infix fun Long.hasFlags(bits: Long): Boolean
Link copied to clipboard
fun Int.insert(value: Boolean, offset: Int): Int

Replaces 1 bit at offset with value and returns the result of doing such replacement

fun Int.insert(value: Int, offset: Int, count: Int): Int

Replaces this bits from offset to offset+count with value and returns the result of doing such replacement

Link copied to clipboard
fun Int.insert1(value: Int, offset: Int): Int
Link copied to clipboard
fun Int.insert10(value: Int, offset: Int): Int
Link copied to clipboard
fun Int.insert11(value: Int, offset: Int): Int
Link copied to clipboard
fun Int.insert12(value: Int, offset: Int): Int
Link copied to clipboard
fun Int.insert13(value: Int, offset: Int): Int
Link copied to clipboard
fun Int.insert14(value: Int, offset: Int): Int
Link copied to clipboard
fun Int.insert15(value: Int, offset: Int): Int
Link copied to clipboard
fun Int.insert16(value: Int, offset: Int): Int
Link copied to clipboard
fun Int.insert17(value: Int, offset: Int): Int
Link copied to clipboard
fun Int.insert18(value: Int, offset: Int): Int
Link copied to clipboard
fun Int.insert19(value: Int, offset: Int): Int
Link copied to clipboard
fun Int.insert2(value: Int, offset: Int): Int
Link copied to clipboard
fun Int.insert20(value: Int, offset: Int): Int
Link copied to clipboard
fun Int.insert21(value: Int, offset: Int): Int
Link copied to clipboard
fun Int.insert22(value: Int, offset: Int): Int
Link copied to clipboard
fun Int.insert23(value: Int, offset: Int): Int
Link copied to clipboard
fun Int.insert24(value: Int, offset: Int): Int
Link copied to clipboard
fun Int.insert25(value: Int, offset: Int): Int
Link copied to clipboard
fun Int.insert26(value: Int, offset: Int): Int
Link copied to clipboard
fun Int.insert27(value: Int, offset: Int): Int
Link copied to clipboard
fun Int.insert28(value: Int, offset: Int): Int
Link copied to clipboard
fun Int.insert29(value: Int, offset: Int): Int
Link copied to clipboard
fun Int.insert3(value: Int, offset: Int): Int
Link copied to clipboard
fun Int.insert30(value: Int, offset: Int): Int
Link copied to clipboard
fun Int.insert31(value: Int, offset: Int): Int
Link copied to clipboard
fun Int.insert32(value: Int, offset: Int): Int
Link copied to clipboard
fun Int.insert4(value: Int, offset: Int): Int
Link copied to clipboard
fun Int.insert5(value: Int, offset: Int): Int
Link copied to clipboard
fun Int.insert6(value: Int, offset: Int): Int
Link copied to clipboard
fun Int.insert7(value: Int, offset: Int): Int
Link copied to clipboard
fun Int.insert8(value: Int, offset: Int): Int
Link copied to clipboard
fun Int.insert9(value: Int, offset: Int): Int
Link copied to clipboard
inline fun Int.insertMask(value: Int, offset: Int, mask: Int): Int
Link copied to clipboard
fun Int.insertNoClear(value: Int, offset: Int, count: Int): Int
Link copied to clipboard
fun Int.insertScaled(value: Int, offset: Int, count: Int, scale: Int): Int
Link copied to clipboard
fun Int.insertScaledf01(value: Float, offset: Int, count: Int): Int

Extracts count at offset from this and convert the possible values into the range 0.0..1.0

Link copied to clipboard
fun Int.insertScaledFF(value: Int, offset: Int, count: Int): Int
Link copied to clipboard
inline fun <T : Int64> int64ArrayOf(vararg values: T): Int64Array
inline fun int64ArrayOf(vararg values: Int): Int64Array
inline fun int64ArrayOf(vararg values: Long): Int64Array
Link copied to clipboard
fun Int.mask(): Int

Creates an Int with this bits set to 1

fun Long.mask(): Long

Creates a Long with this bits set to 1

fun Int.mask(offset: Int): Int

Creates an Int with this bits set to 1, displaced offset bits

fun Long.mask(offset: Int): Long

Creates a Long with this bits set to 1, displaced offset bits

Link copied to clipboard

Returns the float representation of this memory bits

Link copied to clipboard

Returns the float representation of this memory bits

Link copied to clipboard
inline fun Float.reinterpretAsInt(): Int

Returns the bits in memory of this float

Link copied to clipboard

Returns the bits in memory of this float

Link copied to clipboard

Reverse the bits of this Int: abcdef...z -> z...fedcba

Link copied to clipboard

Reverses the bytes of this: AABB -> BBAA

Reverses the bytes of this: AABBCCDD -> DDCCBBAA

Reverses the bytes of this: AABBCCDDEEFFGGHH -> HHGGFFEEDDCCBBAA

Reverses the bytes of this: AABB -> BBAA

Link copied to clipboard
fun Int.rotateLeft(bits: Int): Int
fun Long.rotateLeft(bits: Int): Long
fun UInt.rotateLeft(bits: Int): UInt

Rotates this bits to the left

Link copied to clipboard
fun Int.rotateRight(bits: Int): Int
fun Long.rotateRight(bits: Int): Long
fun UInt.rotateRight(bits: Int): UInt

Rotates this bits to the right

Link copied to clipboard
fun Int.setBits(bits: Int): Int

Returns the integer this with the bits set

fun Int.setBits(bits: Int, set: Boolean): Int

Returns the integer this with the bits set or unset depending on the set parameter

Link copied to clipboard
fun Int.signExtend(bits: Int): Int

Takes nbits of this, and extends the last bit, creating a plain Int in one's complement

fun Long.signExtend(bits: Int): Long

Takes nbits of this, and extends the last bit, creating a plain Long in one's complement

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun Int.unsetBits(bits: Int): Int

Returns the integer this without the bits set

Link copied to clipboard
fun Int.with(bits: Int): Int
fun Long.with(bits: Long): Long
Link copied to clipboard
fun Int.without(bits: Int): Int
fun Long.without(bits: Long): Long