Opens in a new tab
A picture of Jeff Brigman
I CODE TODAY FOR
A BETTER TOMORROW

Glossary Term

BigInt.asIntN()

2 tags 1 category

The BigInt.asIntN() static method truncates a BigInt value to the given number of least significant bits and returns that value as a signed integer.

The BigInt.asIntN method truncates a BigInt value to the given number of bits, and interprets the result as a signed integer. For example, for BigInt.asIntN(3, 25n), the value 25n is truncated to 1n:

If the leading bit of the remaining number is 1, the result is negative. For example, BigInt.asIntN(4, 25n) yields -7n, because 1001 is the encoding of -7 under two’s complement:

Note: BigInt values are always encoded as two’s complement in binary.

Syntax example: BigInt.asIntN(bits, bigint)

Term Connections

Explore related terms connected by shared tags, shared categories, and relationship phrases. This map loads only when it comes into view.

Loading term connections…