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 ** 100nOutput1267650600228229401496703205376nJS BigInt
Common errors
- Mixing Number and BigInt in JS throws
- Use BigInt uniformly or convert explicitly
Related terms
Modular Arithmetic
Modular arithmetic takes remainders after integer operations, keeping results within [0, n); it is the foundation of number theory and cryptography. GLOSSARY
Prime Number
A prime number is a natural number greater than 1 divisible only by 1 and itself; it is the building block of number theory, and every integer factors uniquely into primes. GLOSSARY
Factorial
The factorial n! = n×(n-1)×...×1 is the basis of permutations and combinations; it grows extremely fast, with 20! already exceeding the 64-bit integer range. GLOSSARY