tuweni / org.apache.tuweni.units.bigints / UInt384

UInt384

class UInt384 : UInt384Value<UInt384> (source)

An unsigned 384-bit precision number. This is a raw UInt384Value - a 384-bit precision unsigned number of no particular unit.

Properties

MAX_VALUE

static val MAX_VALUE: UInt384

The maximum value of a UInt384

MIN_VALUE

static val MIN_VALUE: UInt384

The minimum value of a UInt384

ONE

static val ONE: UInt384

The value 1

ZERO

static val ZERO: UInt384

The value 0

Functions

add

fun add(value: UInt384): UInt384
fun add(value: Long): UInt384

addMod

fun addMod(value: UInt384, modulus: UInt384): UInt384
fun addMod(value: Long, modulus: UInt384): UInt384
fun addMod(value: Long, modulus: Long): UInt384

and

fun and(value: UInt384): UInt384

Return a bit-wise AND of this value and the supplied value.

fun and(bytes: Bytes48): UInt384

Return a bit-wise AND of this value and the supplied bytes.

bitLength

fun bitLength(): Int

compareTo

fun compareTo(other: UInt384): Int

divide

fun divide(value: UInt384): UInt384
fun divide(value: Long): UInt384

equals

fun equals(other: Any?): Boolean

fitsInt

fun fitsInt(): Boolean

fitsLong

fun fitsLong(): Boolean

fromBytes

static fun fromBytes(bytes: Bytes): UInt384

Return a UInt384 containing the value described by the specified bytes.

fromHexString

static fun fromHexString(str: String): UInt384

Parse a hexadecimal string into a UInt384.

hashCode

fun hashCode(): Int

intValue

fun intValue(): Int

isZero

fun isZero(): Boolean

mod

fun mod(modulus: UInt384): UInt384
fun mod(modulus: Long): UInt384

multiply

fun multiply(value: UInt384): UInt384
fun multiply(value: Long): UInt384

multiplyMod

fun multiplyMod(value: UInt384, modulus: UInt384): UInt384
fun multiplyMod(value: Long, modulus: UInt384): UInt384
fun multiplyMod(value: Long, modulus: Long): UInt384

not

fun not(): UInt384

Return a bit-wise NOT of this value.

numberOfLeadingZeros

fun numberOfLeadingZeros(): Int

or

fun or(value: UInt384): UInt384

Return a bit-wise OR of this value and the supplied value.

fun or(bytes: Bytes48): UInt384

Return a bit-wise OR of this value and the supplied bytes.

pow

fun pow(exponent: UInt384): UInt384
fun pow(exponent: Long): UInt384

shiftLeft

fun shiftLeft(distance: Int): UInt384

Shift all bits in this value to the left.

shiftRight

fun shiftRight(distance: Int): UInt384

Shift all bits in this value to the right.

subtract

fun subtract(value: UInt384): UInt384
fun subtract(value: Long): UInt384

toBigInteger

fun toBigInteger(): BigInteger

toBytes

fun toBytes(): Bytes48

toLong

fun toLong(): Long

toMinimalBytes

fun toMinimalBytes(): Bytes

toString

fun toString(): String

toUInt384

fun toUInt384(): UInt384

valueOf

static fun valueOf(value: Long): UInt384

Return a UInt384 containing the specified value.

static fun valueOf(value: BigInteger): UInt384

Return a UInt384 containing the specified value.

xor

fun xor(value: UInt384): UInt384

Return a bit-wise XOR of this value and the supplied value.

fun xor(bytes: Bytes48): UInt384

Return a bit-wise XOR of this value and the supplied bytes.

Inherited Functions

addExact

open fun addExact(value: T): T
open fun addExact(value: Long): T

Returns a value that is (this + value).

subtractExact

open fun subtractExact(value: T): T
open fun subtractExact(value: Long): T

Returns a value that is (this - value).

toHexString

open fun toHexString(): String

This value represented as an hexadecimal string.

Note that this representation includes all the 48 underlying bytes, no matter what the integer actually represents (in other words, it can have many leading zeros). For a shorter representation that don't include leading zeros, use #toShortHexString.

toShortHexString

open fun toShortHexString(): String