Skip to content
uencoder

BigInteger

BigInteger is an arbitrary-precision integer type, not limited by a fixed word size, used for computations beyond the native integer range (such as cryptography and combinatorics).

Purpose

To free integer arithmetic from 32/64-bit overflow limits and support arbitrarily large numbers.

Mechanism

It stores the digits (or limbs) of a big number in an array and implements arithmetic digit-wise. Multiplication is accelerated with Karatsuba/FFT. Implementations include Java BigInteger, Python int (automatic big integers), and JS BigInt. It is immutable; operations return new objects.

Use cases

  • RSA big-number arithmetic
  • Large factorials and combinatorics
  • Exact financial computation
  • Number theory and prime research

Examples

  • Input
    2n ** 100n
    Output
    1267650600228229401496703205376n

    JS BigInt

Common errors

Mixing Number and BigInt in JS throws
Use BigInt uniformly or convert explicitly

Related terms

Related tools

References