BigIntegerList63Arithmetic

Interface defining big integer operations

Created by Ugljesa Jovanovic ugljesa.jovanovic@ionspin.com on 10-Mar-2019

Properties

Link copied to clipboard
abstract val basePowerOfTwo: Int
Link copied to clipboard
abstract val ONE: List<ULong>
Link copied to clipboard
abstract val TEN: List<ULong>
Link copied to clipboard
abstract val TWO: List<ULong>
Link copied to clipboard
abstract val ZERO: List<ULong>

Functions

Link copied to clipboard
abstract fun add(first: List<ULong>, second: List<ULong>): List<ULong>

Adds two big integers

Link copied to clipboard
abstract fun and(operand: List<ULong>, mask: List<ULong>): List<ULong>
Link copied to clipboard
abstract fun bitAt(operand: List<ULong>, position: Long): Boolean
Link copied to clipboard
abstract fun bitLength(value: List<ULong>): Int

Number of bits needed to represent this number

Link copied to clipboard
abstract fun compare(first: List<ULong>, second: List<ULong>): Int

Compares two numbers

Link copied to clipboard
abstract fun divide(first: List<ULong>, second: List<ULong>): Pair<List<ULong>, List<ULong>>

Divide two big integers

Link copied to clipboard
abstract fun fromByte(byte: Byte): List<ULong>
Link copied to clipboard
abstract fun fromByteArray(source: ByteArray): List<ULong>
Link copied to clipboard
abstract fun fromInt(int: Int): List<ULong>
Link copied to clipboard
abstract fun fromLong(long: Long): List<ULong>
Link copied to clipboard
abstract fun fromShort(short: Short): List<ULong>
Link copied to clipboard
abstract fun fromUByte(uByte: UByte): List<ULong>
Link copied to clipboard
abstract fun fromUByteArray(source: UByteArray): List<ULong>
Link copied to clipboard
abstract fun fromUInt(uInt: UInt): List<ULong>
Link copied to clipboard
abstract fun fromULong(uLong: ULong): List<ULong>
Link copied to clipboard
abstract fun fromUShort(uShort: UShort): List<ULong>
Link copied to clipboard
abstract fun gcd(first: List<ULong>, second: List<ULong>): List<ULong>
Link copied to clipboard
abstract fun multiply(first: List<ULong>, second: List<ULong>): List<ULong>

Multiplies two big integers

Link copied to clipboard
abstract fun not(operand: List<ULong>): List<ULong>
Link copied to clipboard
abstract fun numberOfDecimalDigits(operand: List<ULong>): Long
Link copied to clipboard
abstract fun numberOfLeadingZerosInAWord(value: ULong): Int

Returns the number of leading zeros in a word

Link copied to clipboard
abstract fun or(operand: List<ULong>, mask: List<ULong>): List<ULong>
Link copied to clipboard
abstract fun parseForBase(number: String, base: Int): List<ULong>

Parse a string in a specific base into a big integer

Link copied to clipboard
abstract fun pow(base: List<ULong>, exponent: Long): List<ULong>

Exponentiation function

Link copied to clipboard
abstract fun reciprocal(operand: List<ULong>): Pair<List<ULong>, List<ULong>>

Returns a integer reciprocal of this number such that 0 <= base ^ word - operand * reciprocal <= operand, and remainder such that 0 < reciprocal < operand

Link copied to clipboard
abstract fun setBitAt(operand: List<ULong>, position: Long, bit: Boolean): List<ULong>
Link copied to clipboard
abstract fun shiftLeft(operand: List<ULong>, places: Int): List<ULong>

Arithmetic shift left. Shifts the number to the left, by required places of bits, creating new words if necessary

Link copied to clipboard
abstract fun shiftRight(operand: List<ULong>, places: Int): List<ULong>

Arithmetic shift right. Shifts the number to the right, by required places of bits, removing words that no longer relevant

Link copied to clipboard
abstract fun sqrt(operand: List<ULong>): Pair<List<ULong>, List<ULong>>
Link copied to clipboard
abstract fun subtract(first: List<ULong>, second: List<ULong>): List<ULong>

Subtracts two big integers

Link copied to clipboard
abstract fun toByteArray(operand: List<ULong>): ByteArray
Link copied to clipboard
abstract fun toString(operand: List<ULong>, base: Int): String

return a string representation of big integer in a specific number base

Link copied to clipboard
abstract fun toUByteArray(operand: List<ULong>): UByteArray
Link copied to clipboard
abstract fun trailingZeroBits(value: List<ULong>): Int

Number of consecutive zeros count from the right in binary representation

Link copied to clipboard
abstract fun xor(operand: List<ULong>, mask: List<ULong>): List<ULong>