Unbounded integer values for handling extremely large numbers
A BigInt in Internet Object represents arbitrary-precision integers that can handle numeric values exceeding the limitations of standard 64-bit number representations. BigInt is a scalar primitive used for extremely large whole numbers with perfect precision, such as in cryptographic operations, large-scale counting, or mathematical computations requiring unbounded integer arithmetic.
Unlike the regular Number type, which is limited to safe integers within approximately ±9 quadrillion (±2^53-1), BigInt can represent integers of arbitrary length, ensuring that large numerical operations remain exact regardless of magnitude.
Syntax
A BigInt value is expressed as an integer with the n suffix:
123 # ❌ Missing 'n' suffix (should be 123n)
123.45n # ❌ BigInt cannot have decimal point (use Decimal for fractions)
123nn # ❌ Multiple suffixes not allowed (should be 123n)
n123 # ❌ Suffix must be at the end (should be 123n)
0b # ❌ Missing binary digits (should be 0b1n)
0xn # ❌ Missing hex digits (should be 0x1n)