abla/uint128

Generated from source.

Import with import "abla/uint128".

Source: abla/uint128/entry.ab

ablaU128NativeMul (extern)

noescape extern:"intrinsic" fun ablaU128NativeMul(): bool

Returns whether the target supports the wide multiply without a runtime helper.

ablaU128_fromU64 (extern)

noescape extern:"intrinsic" fun ablaU128_fromU64(value: u64): uint128

Zero-extends an unsigned 64-bit integer to 128 bits.

ablaU128_fromI64 (extern)

noescape extern:"intrinsic" fun ablaU128_fromI64(value: i64): uint128

Sign-extends a signed 64-bit integer to 128 bits.

ablaU128_toU64 (extern)

noescape extern:"intrinsic" fun ablaU128_toU64(value: uint128): u64

Returns the low 64 bits of the input.

ablaU128_not (extern)

noescape extern:"intrinsic" fun ablaU128_not(value: uint128): uint128

Returns the input with every bit flipped.

ablaU128_add (extern)

noescape extern:"intrinsic" fun ablaU128_add(a: uint128, b: uint128): uint128

Returns the sum modulo 2^128.

ablaU128_sub (extern)

noescape extern:"intrinsic" fun ablaU128_sub(a: uint128, b: uint128): uint128

Returns the difference modulo 2^128.

ablaU128_mul (extern)

noescape extern:"intrinsic" fun ablaU128_mul(a: uint128, b: uint128): uint128

Returns the product modulo 2^128.

ablaU128_udiv (extern)

noescape extern:"intrinsic" fun ablaU128_udiv(a: uint128, b: uint128): uint128

Returns the unsigned quotient for a nonzero divisor.

ablaU128_urem (extern)

noescape extern:"intrinsic" fun ablaU128_urem(a: uint128, b: uint128): uint128

Returns the unsigned remainder for a nonzero divisor.

ablaU128_and (extern)

noescape extern:"intrinsic" fun ablaU128_and(a: uint128, b: uint128): uint128

Returns the bitwise AND of the operands.

ablaU128_or (extern)

noescape extern:"intrinsic" fun ablaU128_or(a: uint128, b: uint128): uint128

Returns the bitwise OR of the operands.

ablaU128_xor (extern)

noescape extern:"intrinsic" fun ablaU128_xor(a: uint128, b: uint128): uint128

Returns the bitwise XOR of the operands.

ablaU128_shl (extern)

noescape extern:"intrinsic" fun ablaU128_shl(a: uint128, count: u32): uint128

Returns the bit pattern shifted left by a count below 128.

ablaU128_lshr (extern)

noescape extern:"intrinsic" fun ablaU128_lshr(a: uint128, count: u32): uint128

Returns the bit pattern shifted right with zero fill by a count below 128.

ablaU128_eq (extern)

noescape extern:"intrinsic" fun ablaU128_eq(a: uint128, b: uint128): bool

Returns whether the two bit patterns are equal.

ablaU128_lt (extern)

noescape extern:"intrinsic" fun ablaU128_lt(a: uint128, b: uint128): bool

Returns whether the first bit pattern is smaller when both are interpreted as unsigned.

ablaU128NarrowTarget (extern)

noescape extern:"intrinsic" fun ablaU128NarrowTarget(): bool

Returns whether the target uses 32-bit pointers outside WebAssembly.

uint128 (fun)

@inline fun uint128(value: int): uint128

As every widening: a signed source sign-extends, so uint128(-1) is the largest value, as u64(-1) is.

uint128 (fun)

@inline fun uint128(value: i32): uint128

As every widening: a signed source sign-extends, so uint128(-1) is the largest value, as u64(-1) is.

uint128 (fun)

@inline fun uint128(value: i16): uint128

As every widening: a signed source sign-extends, so uint128(-1) is the largest value, as u64(-1) is.

uint128 (fun)

@inline fun uint128(value: i8): uint128

As every widening: a signed source sign-extends, so uint128(-1) is the largest value, as u64(-1) is.

uint128 (fun)

@inline fun uint128(value: u64): uint128

As every widening: a signed source sign-extends, so uint128(-1) is the largest value, as u64(-1) is.

uint128 (fun)

@inline fun uint128(value: u32): uint128

As every widening: a signed source sign-extends, so uint128(-1) is the largest value, as u64(-1) is.

uint128 (fun)

@inline fun uint128(value: u16): uint128

As every widening: a signed source sign-extends, so uint128(-1) is the largest value, as u64(-1) is.

uint128 (fun)

@inline fun uint128(value: u8): uint128

As every widening: a signed source sign-extends, so uint128(-1) is the largest value, as u64(-1) is.

uint128Words (fun)

fun uint128Words(w3: u32, w2: u32, w1: u32, w0: u32): uint128

Four words, most significant first: how to write a constant that doesn't fit an int.

uint128Max (fun)

@inline fun uint128Max(): uint128

2^128 - 1.

uint128OrNull (fun)

fun uint128OrNull(value: int): uint128?

Refuses what's below zero, where uint128(value) would extend the sign.

uint128Equal (fun)

@inline fun uint128Equal(a: uint128, b: uint128): bool

What the compiler calls for ==, < and the rest (bootstrapLowerArithmetic), and for "$x".

uint128NotEqual (fun)

@inline fun uint128NotEqual(a: uint128, b: uint128): bool

What the compiler calls for ==, < and the rest (bootstrapLowerArithmetic), and for "$x".

uint128Less (fun)

@inline fun uint128Less(a: uint128, b: uint128): bool

What the compiler calls for ==, < and the rest (bootstrapLowerArithmetic), and for "$x".

uint128LessEqual (fun)

@inline fun uint128LessEqual(a: uint128, b: uint128): bool

What the compiler calls for ==, < and the rest (bootstrapLowerArithmetic), and for "$x".

uint128Greater (fun)

@inline fun uint128Greater(a: uint128, b: uint128): bool

What the compiler calls for ==, < and the rest (bootstrapLowerArithmetic), and for "$x".

uint128GreaterEqual (fun)

@inline fun uint128GreaterEqual(a: uint128, b: uint128): bool

What the compiler calls for ==, < and the rest (bootstrapLowerArithmetic), and for "$x".

uint128Text (fun)

fun uint128Text(value: uint128): string

What the compiler calls for ==, < and the rest (bootstrapLowerArithmetic), and for "$x".

uint128.plus (extension fun)

@inline operator fun uint128.plus(other: uint128): uint128

Returns the sum modulo 2^128.

uint128.minus (extension fun)

@inline operator fun uint128.minus(other: uint128): uint128

Returns the difference modulo 2^128.

uint128.unaryMinus (extension fun)

@inline operator fun uint128.unaryMinus(): uint128

Returns the additive inverse modulo 2^128.

uint128.and (extension fun)

@inline operator fun uint128.and(other: uint128): uint128

Returns the bitwise AND of the operands.

uint128.or (extension fun)

@inline operator fun uint128.or(other: uint128): uint128

Returns the bitwise OR of the operands.

uint128.xor (extension fun)

@inline operator fun uint128.xor(other: uint128): uint128

Returns the bitwise XOR of the operands.

uint128.inv (extension fun)

@inline operator fun uint128.inv(): uint128

Returns the input with every bit flipped.

uint128.times (extension fun)

@inline operator fun uint128.times(other: uint128): uint128

Returns the product modulo 2^128.

uint128.div (extension fun)

@inline operator fun uint128.div(other: uint128): uint128

Returns the unsigned quotient and panics for a zero divisor.

uint128.rem (extension fun)

@inline operator fun uint128.rem(other: uint128): uint128

Returns the unsigned remainder and panics for a zero divisor.

uint128ShiftLeft (fun)

fun uint128ShiftLeft(value: uint128, count: int): uint128

As every width's: a count that's negative or at least the width gives zero.

uint128ShiftRight (fun)

fun uint128ShiftRight(value: uint128, count: int): uint128

Returns the value shifted right with zero fill, or zero for a count outside 0 through 127.

uint128.shl (extension fun)

@inline operator fun uint128.shl(count: int): uint128

Returns the value shifted left, or zero for a count outside 0 through 127.

uint128.shr (extension fun)

@inline operator fun uint128.shr(count: int): uint128

Returns the value shifted right with zero fill, or zero for a count outside 0 through 127.

uint128.shl (extension fun)

@inline operator fun uint128.shl(count: i32): uint128

Returns the value shifted left, or zero for a count outside 0 through 127.

uint128.shr (extension fun)

@inline operator fun uint128.shr(count: i32): uint128

Returns the value shifted right with zero fill, or zero for a count outside 0 through 127.

uint128.shl (extension fun)

@inline operator fun uint128.shl(count: i16): uint128

Returns the value shifted left, or zero for a count outside 0 through 127.

uint128.shr (extension fun)

@inline operator fun uint128.shr(count: i16): uint128

Returns the value shifted right with zero fill, or zero for a count outside 0 through 127.

uint128.shl (extension fun)

@inline operator fun uint128.shl(count: i8): uint128

Returns the value shifted left, or zero for a count outside 0 through 127.

uint128.shr (extension fun)

@inline operator fun uint128.shr(count: i8): uint128

Returns the value shifted right with zero fill, or zero for a count outside 0 through 127.

uint128.shl (extension fun)

@inline operator fun uint128.shl(count: u64): uint128

Returns the value shifted left, or zero for a count outside 0 through 127.

uint128.shr (extension fun)

@inline operator fun uint128.shr(count: u64): uint128

Returns the value shifted right with zero fill, or zero for a count outside 0 through 127.

uint128.shl (extension fun)

@inline operator fun uint128.shl(count: u32): uint128

Returns the value shifted left, or zero for a count outside 0 through 127.

uint128.shr (extension fun)

@inline operator fun uint128.shr(count: u32): uint128

Returns the value shifted right with zero fill, or zero for a count outside 0 through 127.

uint128.shl (extension fun)

@inline operator fun uint128.shl(count: u16): uint128

Returns the value shifted left, or zero for a count outside 0 through 127.

uint128.shr (extension fun)

@inline operator fun uint128.shr(count: u16): uint128

Returns the value shifted right with zero fill, or zero for a count outside 0 through 127.

uint128.shl (extension fun)

@inline operator fun uint128.shl(count: u8): uint128

Returns the value shifted left, or zero for a count outside 0 through 127.

uint128.shr (extension fun)

@inline operator fun uint128.shr(count: u8): uint128

Returns the value shifted right with zero fill, or zero for a count outside 0 through 127.

uint128.shl (extension fun)

fun uint128.shl(count: uint128): uint128

The EVM's SHL and SHR take a 256-bit count.

uint128.shr (extension fun)

fun uint128.shr(count: uint128): uint128

Returns the value shifted right with zero fill, or zero for a count outside 0 through 127.

uint128.isZero (extension fun)

@inline fun uint128.isZero(): bool

Returns whether the value equals zero.

uint128.bit (extension fun)

fun uint128.bit(index: int): bool

Bit index, the least significant being 0; beyond the width, 0.

uint128.bitLength (extension fun)

fun uint128.bitLength(): int

The fewest bits that hold it: 0 for zero.

uint128.addChecked (extension fun)

fun uint128.addChecked(other: uint128): uint128?

The sum, or null if it doesn't fit.

uint128.subChecked (extension fun)

fun uint128.subChecked(other: uint128): uint128?

The difference, or null below zero.

uint128.mulChecked (extension fun)

fun uint128.mulChecked(other: uint128): uint128?

The product, or null if it doesn't fit.

uint128.toU64 (extension fun)

@inline fun uint128.toU64(): u64

Narrowing as every width's does: keeps the low bits.

uint128.toInt (extension fun)

@inline fun uint128.toInt(): int

Narrowing as every width's does: keeps the low bits.

uint128.toU32 (extension fun)

@inline fun uint128.toU32(): u32

Narrowing as every width's does: keeps the low bits.

uint128.toU16 (extension fun)

@inline fun uint128.toU16(): u16

Narrowing as every width's does: keeps the low bits.

uint128.toU8 (extension fun)

@inline fun uint128.toU8(): u8

Narrowing as every width's does: keeps the low bits.

uint128.toU64OrNull (extension fun)

fun uint128.toU64OrNull(): u64?

Or null if it doesn't fit.

uint128.toIntOrNull (extension fun)

fun uint128.toIntOrNull(): int?

Returns the value as int, or null if it cannot be represented.

uint128.toU32OrNull (extension fun)

fun uint128.toU32OrNull(): u32?

Returns the value as u32, or null if it cannot be represented.

uint128.toU16OrNull (extension fun)

fun uint128.toU16OrNull(): u16?

Returns the value as u16, or null if it cannot be represented.

uint128.toU8OrNull (extension fun)

fun uint128.toU8OrNull(): u8?

Returns the value as u8, or null if it cannot be represented.

uint128.toDecimal (extension fun)

fun uint128.toDecimal(): string

In decimal, as "$x" writes it.

uint128.toHex (extension fun)

fun uint128.toHex(): string

In hex with 0x, in lower case, and no leading zeros: a JSON-RPC quantity.

uint128FromDecimal (fun)

fun uint128FromDecimal(text: string): uint128?

Digits only: no sign, space or point; leading zeros are allowed. Null if it isn't that, or doesn't fit.

uint128FromHex (fun)

fun uint128FromHex(text: string): uint128?

With or without 0x, in either case. Null with no digits, on anything else, or if it doesn't fit.

uint128.toBytes (extension fun)

fun uint128.toBytes(): string

16 bytes, big-endian: an EVM word.

uint128FromBytes (fun)

fun uint128FromBytes(bytes: string): uint128?

Big-endian bytes, fewer than 16 padding on the left. Null above 16.

uint128.toBytesLittleEndian (extension fun)

fun uint128.toBytesLittleEndian(): string

16 bytes, little-endian: the least significant byte first.

uint128FromBytesLittleEndian (fun)

fun uint128FromBytesLittleEndian(bytes: string): uint128?

Little-endian bytes, fewer than 16 padding at the top. Null above 16.

Built from Abla v0.2.79 source ba5d6b7d. Examples and generated signatures follow that source revision.