abla/int256
Generated from source.
Import with import "abla/int256".
Source: abla/int256/entry.ab
ablaI256NativeMul (extern)
noescape extern:"intrinsic" fun ablaI256NativeMul(): bool
Returns whether the target supports the wide multiply without a runtime helper.
ablaI256_fromU64 (extern)
noescape extern:"intrinsic" fun ablaI256_fromU64(value: u64): int256
Zero-extends an unsigned 64-bit integer to 256 bits.
ablaI256_fromI64 (extern)
noescape extern:"intrinsic" fun ablaI256_fromI64(value: i64): int256
Sign-extends a signed 64-bit integer to 256 bits.
ablaI256_toU64 (extern)
noescape extern:"intrinsic" fun ablaI256_toU64(value: int256): u64
Returns the low 64 bits of the input.
ablaI256_not (extern)
noescape extern:"intrinsic" fun ablaI256_not(value: int256): int256
Returns the input with every bit flipped.
ablaI256_add (extern)
noescape extern:"intrinsic" fun ablaI256_add(a: int256, b: int256): int256
Returns the sum modulo 2^256.
ablaI256_sub (extern)
noescape extern:"intrinsic" fun ablaI256_sub(a: int256, b: int256): int256
Returns the difference modulo 2^256.
ablaI256_mul (extern)
noescape extern:"intrinsic" fun ablaI256_mul(a: int256, b: int256): int256
Returns the product modulo 2^256.
ablaI256_udiv (extern)
noescape extern:"intrinsic" fun ablaI256_udiv(a: int256, b: int256): int256
Returns the unsigned quotient for a nonzero divisor.
ablaI256_urem (extern)
noescape extern:"intrinsic" fun ablaI256_urem(a: int256, b: int256): int256
Returns the unsigned remainder for a nonzero divisor.
ablaI256_sdiv (extern)
noescape extern:"intrinsic" fun ablaI256_sdiv(a: int256, b: int256): int256
Returns the signed quotient truncated toward zero when the divisor is nonzero and the quotient is representable.
ablaI256_srem (extern)
noescape extern:"intrinsic" fun ablaI256_srem(a: int256, b: int256): int256
Returns the signed remainder for a nonzero divisor when the signed division quotient is representable.
ablaI256_and (extern)
noescape extern:"intrinsic" fun ablaI256_and(a: int256, b: int256): int256
Returns the bitwise AND of the operands.
ablaI256_or (extern)
noescape extern:"intrinsic" fun ablaI256_or(a: int256, b: int256): int256
Returns the bitwise OR of the operands.
ablaI256_xor (extern)
noescape extern:"intrinsic" fun ablaI256_xor(a: int256, b: int256): int256
Returns the bitwise XOR of the operands.
ablaI256_shl (extern)
noescape extern:"intrinsic" fun ablaI256_shl(a: int256, count: u32): int256
Returns the bit pattern shifted left by a count below 256.
ablaI256_lshr (extern)
noescape extern:"intrinsic" fun ablaI256_lshr(a: int256, count: u32): int256
Returns the bit pattern shifted right with zero fill by a count below 256.
ablaI256_ashr (extern)
noescape extern:"intrinsic" fun ablaI256_ashr(a: int256, count: u32): int256
Returns the bit pattern shifted right with sign extension by a count below 256.
ablaI256_eq (extern)
noescape extern:"intrinsic" fun ablaI256_eq(a: int256, b: int256): bool
Returns whether the two bit patterns are equal.
ablaI256_lt (extern)
noescape extern:"intrinsic" fun ablaI256_lt(a: int256, b: int256): bool
Returns whether the first bit pattern is smaller when both are interpreted as unsigned.
ablaI256_slt (extern)
noescape extern:"intrinsic" fun ablaI256_slt(a: int256, b: int256): bool
Returns whether the first value is smaller when both are interpreted as signed.
ablaI256NarrowTarget (extern)
noescape extern:"intrinsic" fun ablaI256NarrowTarget(): bool
Returns whether the target uses 32-bit pointers outside WebAssembly.
int256 (fun)
@inline fun int256(value: int): int256
As every widening: a signed source extends its sign, an unsigned one its zeros.
int256 (fun)
@inline fun int256(value: i32): int256
As every widening: a signed source extends its sign, an unsigned one its zeros.
int256 (fun)
@inline fun int256(value: i16): int256
As every widening: a signed source extends its sign, an unsigned one its zeros.
int256 (fun)
@inline fun int256(value: i8): int256
As every widening: a signed source extends its sign, an unsigned one its zeros.
int256 (fun)
@inline fun int256(value: u64): int256
As every widening: a signed source extends its sign, an unsigned one its zeros.
int256 (fun)
@inline fun int256(value: u32): int256
As every widening: a signed source extends its sign, an unsigned one its zeros.
int256 (fun)
@inline fun int256(value: u16): int256
As every widening: a signed source extends its sign, an unsigned one its zeros.
int256 (fun)
@inline fun int256(value: u8): int256
As every widening: a signed source extends its sign, an unsigned one its zeros.
int256Words (fun)
fun int256Words(w7: u32, w6: u32, w5: u32, w4: u32, w3: u32, w2: u32, w1: u32, w0: u32): int256
Eight words of its two's complement, most significant first: how to write a constant that doesn't fit an int.
int256Max (fun)
fun int256Max(): int256
2^255 - 1.
int256Min (fun)
fun int256Min(): int256
-2^255.
int256Equal (fun)
@inline fun int256Equal(a: int256, b: int256): bool
What the compiler calls for ==, < and the rest (bootstrapLowerArithmetic), and for "$x".
int256NotEqual (fun)
@inline fun int256NotEqual(a: int256, b: int256): bool
What the compiler calls for ==, < and the rest (bootstrapLowerArithmetic), and for "$x".
int256Less (fun)
@inline fun int256Less(a: int256, b: int256): bool
What the compiler calls for ==, < and the rest (bootstrapLowerArithmetic), and for "$x".
int256LessEqual (fun)
@inline fun int256LessEqual(a: int256, b: int256): bool
What the compiler calls for ==, < and the rest (bootstrapLowerArithmetic), and for "$x".
int256Greater (fun)
@inline fun int256Greater(a: int256, b: int256): bool
What the compiler calls for ==, < and the rest (bootstrapLowerArithmetic), and for "$x".
int256GreaterEqual (fun)
@inline fun int256GreaterEqual(a: int256, b: int256): bool
What the compiler calls for ==, < and the rest (bootstrapLowerArithmetic), and for "$x".
int256Text (fun)
fun int256Text(value: int256): string
What the compiler calls for ==, < and the rest (bootstrapLowerArithmetic), and for "$x".
int256.plus (extension fun)
@inline operator fun int256.plus(other: int256): int256
Returns the sum modulo 2^256.
int256.minus (extension fun)
@inline operator fun int256.minus(other: int256): int256
Returns the difference modulo 2^256.
int256.unaryMinus (extension fun)
@inline operator fun int256.unaryMinus(): int256
Returns the additive inverse modulo 2^256.
int256.and (extension fun)
@inline operator fun int256.and(other: int256): int256
Returns the bitwise AND of the operands.
int256.or (extension fun)
@inline operator fun int256.or(other: int256): int256
Returns the bitwise OR of the operands.
int256.xor (extension fun)
@inline operator fun int256.xor(other: int256): int256
Returns the bitwise XOR of the operands.
int256.inv (extension fun)
@inline operator fun int256.inv(): int256
Returns the input with every bit flipped.
int256.times (extension fun)
@inline operator fun int256.times(other: int256): int256
Returns the product modulo 2^256.
int256.div (extension fun)
@inline operator fun int256.div(other: int256): int256
Returns the signed quotient truncated toward zero, wrapping the minimum value divided by -1 and panicking for zero.
int256.rem (extension fun)
@inline operator fun int256.rem(other: int256): int256
Returns the remainder with the dividend's sign when nonzero and panics for a zero divisor.
int256ShiftLeft (fun)
fun int256ShiftLeft(value: int256, count: int): int256
As every width's: a count that's negative or at least the width gives zero.
int256ShiftRight (fun)
fun int256ShiftRight(value: int256, count: int): int256
Returns the value shifted right with sign extension, or zero for a count outside 0 through 255.
int256UnsignedShiftRight (fun)
fun int256UnsignedShiftRight(value: int256, count: int): int256
Returns the value shifted right with zero fill, or zero for a count outside 0 through 255.
int256.shl (extension fun)
@inline operator fun int256.shl(count: int): int256
Returns the value shifted left, or zero for a count outside 0 through 255.
int256.shr (extension fun)
@inline operator fun int256.shr(count: int): int256
Returns the value shifted right with sign extension, or zero for a count outside 0 through 255.
int256.shl (extension fun)
@inline operator fun int256.shl(count: i32): int256
Returns the value shifted left, or zero for a count outside 0 through 255.
int256.shr (extension fun)
@inline operator fun int256.shr(count: i32): int256
Returns the value shifted right with sign extension, or zero for a count outside 0 through 255.
int256.shl (extension fun)
@inline operator fun int256.shl(count: i16): int256
Returns the value shifted left, or zero for a count outside 0 through 255.
int256.shr (extension fun)
@inline operator fun int256.shr(count: i16): int256
Returns the value shifted right with sign extension, or zero for a count outside 0 through 255.
int256.shl (extension fun)
@inline operator fun int256.shl(count: i8): int256
Returns the value shifted left, or zero for a count outside 0 through 255.
int256.shr (extension fun)
@inline operator fun int256.shr(count: i8): int256
Returns the value shifted right with sign extension, or zero for a count outside 0 through 255.
int256.shl (extension fun)
@inline operator fun int256.shl(count: u64): int256
Returns the value shifted left, or zero for a count outside 0 through 255.
int256.shr (extension fun)
@inline operator fun int256.shr(count: u64): int256
Returns the value shifted right with sign extension, or zero for a count outside 0 through 255.
int256.shl (extension fun)
@inline operator fun int256.shl(count: u32): int256
Returns the value shifted left, or zero for a count outside 0 through 255.
int256.shr (extension fun)
@inline operator fun int256.shr(count: u32): int256
Returns the value shifted right with sign extension, or zero for a count outside 0 through 255.
int256.shl (extension fun)
@inline operator fun int256.shl(count: u16): int256
Returns the value shifted left, or zero for a count outside 0 through 255.
int256.shr (extension fun)
@inline operator fun int256.shr(count: u16): int256
Returns the value shifted right with sign extension, or zero for a count outside 0 through 255.
int256.shl (extension fun)
@inline operator fun int256.shl(count: u8): int256
Returns the value shifted left, or zero for a count outside 0 through 255.
int256.shr (extension fun)
@inline operator fun int256.shr(count: u8): int256
Returns the value shifted right with sign extension, or zero for a count outside 0 through 255.
int256.ushr (extension fun)
@inline fun int256.ushr(count: int): int256
>>>: logical, zeros shifted in whatever the sign.
int256.isZero (extension fun)
@inline fun int256.isZero(): bool
Returns whether the value equals zero.
int256.isNegative (extension fun)
@inline fun int256.isNegative(): bool
Returns whether the value is below zero.
int256.signum (extension fun)
fun int256.signum(): int
-1, 0 or 1.
int256.abs (extension fun)
fun int256.abs(): int256
The magnitude; the smallest value has none that fits, and stays itself.
int256.bit (extension fun)
fun int256.bit(index: int): bool
Bit index of its two's complement, the least significant being 0; beyond the width, the sign.
int256.addChecked (extension fun)
fun int256.addChecked(other: int256): int256?
The sum, or null if it doesn't fit.
int256.subChecked (extension fun)
fun int256.subChecked(other: int256): int256?
The difference, or null if it doesn't fit.
int256.mulChecked (extension fun)
fun int256.mulChecked(other: int256): int256?
The product, or null if it doesn't fit.
int256.toU64 (extension fun)
@inline fun int256.toU64(): u64
Narrowing as every width's does: keeps the low bits.
int256.toInt (extension fun)
@inline fun int256.toInt(): int
Narrowing as every width's does: keeps the low bits.
int256.toI32 (extension fun)
@inline fun int256.toI32(): i32
Narrowing as every width's does: keeps the low bits.
int256.toU32 (extension fun)
@inline fun int256.toU32(): u32
Narrowing as every width's does: keeps the low bits.
int256.toU16 (extension fun)
@inline fun int256.toU16(): u16
Narrowing as every width's does: keeps the low bits.
int256.toU8 (extension fun)
@inline fun int256.toU8(): u8
Narrowing as every width's does: keeps the low bits.
int256.toIntOrNull (extension fun)
fun int256.toIntOrNull(): int?
Or null if it doesn't fit.
int256.toI32OrNull (extension fun)
fun int256.toI32OrNull(): i32?
Returns the value as i32, or null if it cannot be represented.
int256.toU64OrNull (extension fun)
fun int256.toU64OrNull(): u64?
Returns the value as u64, or null if it cannot be represented.
int256.toU32OrNull (extension fun)
fun int256.toU32OrNull(): u32?
Returns the value as u32, or null if it cannot be represented.
int256.toU16OrNull (extension fun)
fun int256.toU16OrNull(): u16?
Returns the value as u16, or null if it cannot be represented.
int256.toU8OrNull (extension fun)
fun int256.toU8OrNull(): u8?
Returns the value as u8, or null if it cannot be represented.
int256.toDecimal (extension fun)
fun int256.toDecimal(): string
In decimal, as "$x" writes it: a minus for a negative one.
int256.toHex (extension fun)
fun int256.toHex(): string
In hex with 0x, in lower case, no leading zeros, a minus before the 0x for a negative one.
int256FromDecimal (fun)
fun int256FromDecimal(text: string): int256?
Digits with an optional leading minus (no plus, space or point); leading zeros are allowed. Null if it isn't that, or doesn't fit.
int256FromHex (fun)
fun int256FromHex(text: string): int256?
With or without 0x, in either case, after an optional minus. Null with no digits, on anything else, or if it doesn't fit.
int256.toBytes (extension fun)
fun int256.toBytes(): string
32 bytes, big-endian, in two's complement.
int256.toBytesLittleEndian (extension fun)
fun int256.toBytesLittleEndian(): string
32 bytes, little-endian: the least significant byte first.
int256FromBytes (fun)
fun int256FromBytes(bytes: string): int256?
Big-endian bytes, fewer than 32 extending the sign of the first. Null above 32.
int256FromBytesLittleEndian (fun)
fun int256FromBytesLittleEndian(bytes: string): int256?
Little-endian bytes, fewer than 32 extending the sign of the last. Null above 32.
Built from Abla v0.2.79 source ba5d6b7d. Examples and generated signatures follow that source revision.