BigInt.asIntN

Returns a new BigInt extracting the low bits of the given BigInt and interpreting them as a two’s complement signed integer, discarding higher bits.

Syntax

BigInt.asIntN(bits, int)

Parameters

Return value

A signed value of BigInt modulo 2**bits.

Examples

BigInt.asIntN(3, 0b11110n).toString(2)
-10

See also