BigInt

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:

bigint = ["-" | "+"] (decimalBigInt | binaryBigInt | octalBigInt | hexBigInt)

decimalBigInt = digit+ "n"
binaryBigInt = "0b" binaryDigit+ "n"
octalBigInt = "0o" octalDigit+ "n"
hexBigInt = "0x" hexDigit+ "n"

digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"
binaryDigit = "0" | "1"
octalDigit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7"
hexDigit = digit | "A" | "B" | "C" | "D" | "E" | "F" | "a" | "b" | "c" | "d" | "e" | "f"

Structural Characters

Symbol
Name
Unicode
Description

n

BigInt Suffix

U+006E

Identifies value as BigInt

0-9

Digits

Multiple

Standard decimal digits

-

Minus Sign

U+002D

Indicates negative numbers

0b

Binary Prefix

Multiple

Binary number indicator

0o

Octal Prefix

Multiple

Octal number indicator

0x

Hex Prefix

Multiple

Hexadecimal number indicator

Valid Forms

Decimal BigInt

Alternative Bases

Optional Behaviors

Literal and Alternate Forms

BigInt values support multiple equivalent representations:

Integer-Only Operations

BigInt values represent whole numbers only and do not support fractional components:

Arbitrary Precision

BigInt values maintain exact precision regardless of magnitude:

Invalid Forms

Preservation of Structure

Internet Object preserves:

  • The chosen representation form (decimal, binary, octal, hex)

  • Exact integer precision regardless of magnitude

  • Syntactic fidelity (as written, except that an explicit plus sign is not preserved)

However, it does not interpret:

  • Mathematical relationships between values

  • Domain-specific constraints on large integers

  • Performance implications of arbitrary-precision arithmetic

Such semantics are the responsibility of the schema layer, validators, or application logic.

See Also

Last updated

Was this helpful?