Programming Search⌘K

Conceptcore

Arbitrary-precision arithmetic

Also called bignum, bignum arithmetic, big integer, BigInteger, BigInt, multiple-precision arithmetic, infinite-precision arithmetic, arbitrary-precision integer.

Arbitrary-precision arithmetic stores a number as a list of digits that grows as needed, so integers do not overflow. The cost is speed and memory that grow with the size of the number.

Applies to
core-languages

Idea

A fixed-width integer has a set number of bits, so it can hold only a set range of values. Arbitrary-precision arithmetic, also called bignum arithmetic, removes that limit. Wikipedia says the calculations are "performed on numbers whose digits of precision are potentially limited only by the available memory of the host system"1. The hardware arithmetic of most processors "typically offers between 8 and 64 bits of precision"1.

A bignum does not fit in one machine word. It is stored as a sequence of digits in a large base, for example 2^32. The implementations "typically use variable-length arrays of digits"1, and the array grows when a result needs more digits. Each operation works on the digits one at a time, with a carry, as on paper.

BASE = 2**32


def to_digits(n):
    digits = []
    while n:
        digits.append(n % BASE)
        n //= BASE
    return digits or [0]


def from_digits(digits):
    n = 0
    for d in reversed(digits):
        n = n * BASE + d
    return n


def add(a, b):
    out, carry = [], 0
    for i in range(max(len(a), len(b))):
        s = (a[i] if i < len(a) else 0) + (b[i] if i < len(b) else 0) + carry
        out.append(s % BASE)
        carry = s // BASE
    if carry:
        out.append(carry)
    return out


def mul(a, b):
    out = [0] * (len(a) + len(b))
    for i, x in enumerate(a):
        carry = 0
        for j, y in enumerate(b):
            t = out[i + j] + x * y + carry
            out[i + j] = t % BASE
            carry = t // BASE
        out[i + len(b)] += carry
    while len(out) > 1 and out[-1] == 0:
        out.pop()
    return out


x = 2**64 - 1
y = 2**100 + 12345
dx, dy = to_digits(x), to_digits(y)
print("x digits:", dx)
print("y digits:", dy)
s = add(dx, dy)
p = mul(dx, dy)
print("sum digits:", len(s), "ok:", "yes" if from_digits(s) == x + y else "no")
print("product digits:", len(p), "ok:", "yes" if from_digits(p) == x * y else "no")
Output
x digits: [4294967295, 4294967295]
y digits: [12345, 0, 0, 16]
sum digits: 4 ok: yes
product digits: 6 ok: yes

The block keeps each number as a list of base 2^32 digits, with the lowest digit first. The addition carries from one digit to the next, and the multiplication is the method of school. CPython stores its int as "an arbitrary length number stored in binary form"2, so the block checks its results against int.

How it works

Where the support is. Some languages use bignums for all integers. Wikipedia names "Lisp, Python, Perl, Haskell, Ruby and Raku"1, and says that this "eliminates the concern of incorrect results (or exceptions) due to simple overflow"1. In Python, "Integers have unlimited precision."2 Other languages keep fixed-width integers as the default and give a separate bignum type:

  • Java has java.math.BigInteger, "Immutable arbitrary-precision integers"3. Its operations "exactly mimic those of Java's integer arithmetic operators"3, so division by zero throws an ArithmeticException.
  • JavaScript has the bigint primitive, written with an n after the literal, as in 10n4. "BigInt values represent integer values which are too high or too low to be represented by the number primitive."4
  • C# has System.Numerics.BigInteger, "an immutable type that represents an arbitrarily large integer whose value in theory has no upper or lower bounds"5.
  • Go has the math/big package, which "implements arbitrary-precision arithmetic (big numbers)"6 with the types Int, Rat and Float.
  • Rust has no bignum in the standard library. The num-bigint crate has BigUint, which is "represented as a vector of digits"7, and BigInt.
  • C and C++ have no bignum in the standard library. GMP is "a free library for arbitrary-precision arithmetic, operating on signed integers, rational numbers, and floating-point numbers"8, and it has a C++ interface with the class mpz_class8.

Growth. The size of a result depends on the size of the operands. The sum of two N-digit numbers has at most N + 1 digits, and the product has at most 2N digits. So a loop that multiplies again and again, such as a factorial, makes numbers that get longer at each step, and each step takes more time than the one before it.

Immutable values and in-place values. In Java and C#, an operation returns a new object. Microsoft says that number++ on a BigInteger does not change the object: the runtime "creates a new BigInteger object and assigns it a value one greater than its previous value"5. Go uses the opposite design to reuse memory. "the invocation c.Add(a, b) computes the sum a + b and stores the result in c"6, and the result can be one of the operands, which "may be safely overwritten (and its memory reused)"6.

The limits that stay. A bignum is limited by memory and time, not by a word size. In .NET, "an OutOfMemoryException can be thrown for any operation that causes a BigInteger value to grow too large"5. Java requires a large range, not an unlimited one: "An ArithmeticException is thrown when a BigInteger constructor or method would generate a value outside of the supported range."3 CPython limits the conversion of large integers to and from decimal strings, which is slow: "CPython has a global limit for converting between int and str to mitigate denial of service attacks."2 The default limit is 4300 digits2. "Hexadecimal, octal, and binary conversions are unlimited."2

In languages

LanguageVerdictNote
PythonNative
C++Library
JavaStandard library
CLibrary
C#Standard library
JavaScriptNative
TypeScriptNativeTypeScript has the bigint type of JavaScript, with literals such as 10n. No example file exists.
GoStandard library
RustLibrary
KotlinStandard libraryKotlin on the JVM uses java.math.BigInteger from the Java class library. No example file exists because kotlinc is not installed.
SQLAbsentThe SQL integer types have a fixed width, and NUMERIC and DECIMAL have a declared precision. No example file exists.
BashAbsentBash arithmetic expansion uses fixed-width integers, so a script calls an external tool for big values. No example file exists.
PowerShellStandard libraryPowerShell has the [bigint] type, which is System.Numerics.BigInteger from .NET. No example file exists because pwsh is not installed.
HTMLDoes not applyHTML has no arithmetic.
CSSDoes not applyCSS math functions work on numbers and dimensions, and there is no big integer type.
Regular expressionsDoes not applyA pattern matches digits as text but does no arithmetic.
Language Verdict Big integer type
Python native every int is a bignum
JavaScript native bigint, with literals such as 10n
TypeScript native bigint, as JavaScript
Java stdlib java.math.BigInteger
Kotlin stdlib java.math.BigInteger on the JVM
C# stdlib System.Numerics.BigInteger
Go stdlib math/big Int, Rat and Float
Rust library the num-bigint crate
C library GMP mpz_t
C++ library GMP mpz_class
Bash absent $(( )) uses fixed-width integers
PowerShell stdlib [bigint], which is .NET BigInteger
SQL absent integer types have a fixed width; NUMERIC has a declared precision
Regex n/a no arithmetic
HTML n/a no arithmetic
CSS n/a no big integer type

In JavaScript, a bigint "cannot be mixed with a Number value in operations; they must be coerced to the same type"4, and / on two bigint values "truncates fractional components towards zero"4. In Python, the change from small to large values is not visible, because there is one int type.

PythonGitHub
import math
import sys

print("2**64:", 2**64)
print("2**100:", 2**100)
print("30!:", math.factorial(30))
print("(2**100).bit_length():", (2**100).bit_length())
print("10**30 // 7:", 10**30 // 7)
print("str limit:", sys.get_int_max_str_digits())
big = 10**5000
try:
    print(len(str(big)))
except ValueError as e:
    print("str(10**5000):", type(e).__name__)
print("hex digits of 10**5000:", len(hex(big)) - 2)
Output
2**64: 18446744073709551616
2**100: 1267650600228229401496703205376
30!: 265252859812191058636308480000000
(2**100).bit_length(): 101
10**30 // 7: 142857142857142857142857142857
str limit: 4300
str(10**5000): ValueError
hex digits of 10**5000: 4153
  • Verdict: native. Every int is a bignum, so 2**100 and 30! need no special type.
  • CPython limits the conversion of an int to a decimal string to 4300 digits by default, and raises ValueError above it. The conversion to hexadecimal has no limit.
  • sys.set_int_max_str_digits changes the limit.
#include <cstdint>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>

class BigNat {
public:
    explicit BigNat(std::uint32_t v) : d_{v} {}

    BigNat &operator*=(std::uint32_t m) {
        std::uint64_t carry = 0;
        for (auto &d : d_) {
            std::uint64_t t = std::uint64_t{d} * m + carry;
            d = static_cast<std::uint32_t>(t % kBase);
            carry = t / kBase;
        }
        while (carry > 0) {
            d_.push_back(static_cast<std::uint32_t>(carry % kBase));
            carry /= kBase;
        }
        return *this;
    }

    std::string str() const {
        std::ostringstream out;
        out << d_.back();
        for (auto it = d_.rbegin() + 1; it != d_.rend(); ++it) {
            out << std::setw(9) << std::setfill('0') << *it;
        }
        return out.str();
    }

private:
    static constexpr std::uint64_t kBase = 1000000000;
    std::vector<std::uint32_t> d_;
};

int main() {
    unsigned long long w = 1;
    for (unsigned long long i = 1; i <= 21; ++i) {
        w *= i;
    }
    std::cout << "21! in unsigned long long: " << w << '\n';

    BigNat f(1);
    for (std::uint32_t i = 1; i <= 30; ++i) {
        f *= i;
    }
    std::cout << "30!: " << f.str() << '\n';
    BigNat p(1);
    for (int i = 0; i < 100; ++i) {
        p *= 2;
    }
    std::cout << "2^100: " << p.str() << '\n';
    BigNat h(1);
    for (std::uint32_t i = 1; i <= 100; ++i) {
        h *= i;
    }
    std::cout << "decimal digits of 100!: " << h.str().size() << '\n';
}
Output
21! in unsigned long long: 14197454024290336768
30!: 265252859812191058636308480000000
2^100: 1267650600228229401496703205376
decimal digits of 100!: 158
  • Verdict: library. The C++ standard library has no bignum type. GMP has a C++ interface with the class mpz_class.
  • 21! does not fit in 64 bits, so the unsigned product wraps modulo 2^64 without an error.
  • The class keeps a std::vector of base 10^9 digits, which grows when a carry is left over.
JavaGitHub
import java.math.BigInteger;

public class Main {
  public static void main(String[] args) {
    BigInteger two = BigInteger.TWO;
    System.out.println("2^64: " + two.pow(64));
    System.out.println("2^100: " + two.pow(100));
    BigInteger f = BigInteger.ONE;
    for (int i = 1; i <= 30; i++) {
      f = f.multiply(BigInteger.valueOf(i));
    }
    System.out.println("30!: " + f);
    long a = Long.MAX_VALUE;
    System.out.println("valueOf(a * 2): " + BigInteger.valueOf(a * 2));
    System.out.println("valueOf(a).multiply(2): " + BigInteger.valueOf(a).multiply(two));
    BigInteger big = two.pow(64);
    try {
      System.out.println(big.longValueExact());
    } catch (ArithmeticException e) {
      System.out.println("longValueExact(): ArithmeticException");
    }
    System.out.println("longValue(): " + big.longValue());
    BigInteger m7 = BigInteger.valueOf(-7);
    BigInteger three = BigInteger.valueOf(3);
    System.out.println("-7 remainder 3: " + m7.remainder(three));
    System.out.println("-7 mod 3: " + m7.mod(three));
  }
}
Output
2^64: 18446744073709551616
2^100: 1267650600228229401496703205376
30!: 265252859812191058636308480000000
valueOf(a * 2): -2
valueOf(a).multiply(2): 18446744073709551614
longValueExact(): ArithmeticException
longValue(): 0
-7 remainder 3: -1
-7 mod 3: 2
  • Verdict: stdlib. java.math.BigInteger is a class, so the program calls methods such as multiply and pow in place of operators.
  • BigInteger.valueOf(a * 2) overflows in long before the conversion. Convert first, then multiply.
  • longValueExact throws when the value does not fit, and longValue keeps only the low 64 bits.
  • remainder follows %, and mod gives a result that is never negative.
#include <stdint.h>
#include <stdio.h>

#define CAP 64
#define BASE 1000000000u

typedef struct {
    uint32_t d[CAP];
    int n;
} big;

static void big_one(big *b) {
    b->d[0] = 1;
    b->n = 1;
}

static int big_mul_small(big *b, uint32_t m) {
    uint64_t carry = 0;
    for (int i = 0; i < b->n; i++) {
        uint64_t t = (uint64_t)b->d[i] * m + carry;
        b->d[i] = (uint32_t)(t % BASE);
        carry = t / BASE;
    }
    while (carry > 0) {
        if (b->n == CAP) {
            return -1;
        }
        b->d[b->n++] = (uint32_t)(carry % BASE);
        carry /= BASE;
    }
    return 0;
}

static void big_print(const char *label, const big *b) {
    printf("%s: %u", label, (unsigned)b->d[b->n - 1]);
    for (int i = b->n - 2; i >= 0; i--) {
        printf("%09u", (unsigned)b->d[i]);
    }
    printf("\n");
}

int main(void) {
    uint64_t f = 1;
    uint64_t next = 0;
    unsigned n = 1;
    while (!__builtin_mul_overflow(f, (uint64_t)n + 1, &next)) {
        f = next;
        n++;
    }
    printf("largest n! in uint64_t: %u! = %llu\n", n, (unsigned long long)f);

    big b;
    big_one(&b);
    for (uint32_t i = 1; i <= 30; i++) {
        big_mul_small(&b, i);
    }
    big_print("30!", &b);
    big_one(&b);
    for (int i = 0; i < 100; i++) {
        big_mul_small(&b, 2);
    }
    big_print("2^100", &b);
    return 0;
}
Output
largest n! in uint64_t: 20! = 2432902008176640000
30!: 265252859812191058636308480000000
2^100: 1267650600228229401496703205376
  • Verdict: library. C has no bignum type, and GMP is the usual library, with the mpz_t type for integers.
  • The block keeps a number as an array of base 10^9 digits. The fixed CAP keeps the code short, and big_mul_small returns -1 when the array is full.
  • __builtin_mul_overflow reports the overflow of a fixed-width product, so the first loop finds the largest factorial that fits.
using System;
using System.Numerics;

BigInteger two = 2;
Console.WriteLine($"2^64: {BigInteger.Pow(two, 64)}");
Console.WriteLine($"2^100: {BigInteger.Pow(two, 100)}");
BigInteger f = 1;
for (int i = 1; i <= 30; i++)
{
    f *= i;
}
Console.WriteLine($"30!: {f}");
Console.WriteLine($"ulong.MaxValue^3: {BigInteger.Pow(ulong.MaxValue, 3)}");
BigInteger big = BigInteger.Pow(two, 64);
try
{
    long x = (long)big;
    Console.WriteLine(x);
}
catch (OverflowException)
{
    Console.WriteLine("(long)2^64: OverflowException");
}
BigInteger n = big;
n++;
Console.WriteLine($"big: {big}");
Console.WriteLine($"n: {n}");
Console.WriteLine($"-7 / 2: {BigInteger.Divide(-7, 2)}");
Output
2^64: 18446744073709551616
2^100: 1267650600228229401496703205376
30!: 265252859812191058636308480000000
ulong.MaxValue^3: 6277101735386680762814942322444851025767571854389858533375
(long)2^64: OverflowException
big: 18446744073709551616
n: 18446744073709551617
-7 / 2: -3
  • Verdict: stdlib. System.Numerics.BigInteger has the usual operators, and an int or a ulong converts to it without a cast.
  • The explicit conversion to long throws an OverflowException when the value does not fit.
  • n++ makes a new value for n, and big keeps its value, because BigInteger is immutable.
JavaScriptGitHub
console.log(`2n ** 64n: ${2n ** 64n}`);
console.log(`2n ** 100n: ${2n ** 100n}`);
let f = 1n;
for (let i = 1n; i <= 30n; i++) {
  f *= i;
}
console.log(`30!: ${f}`);
console.log(`-7n / 2n: ${-7n / 2n}`);
console.log(`MAX_SAFE_INTEGER + 2: ${Number.MAX_SAFE_INTEGER + 2}`);
console.log(`BigInt(MAX_SAFE_INTEGER) + 2n: ${BigInt(Number.MAX_SAFE_INTEGER) + 2n}`);
console.log(`Number(2n ** 64n + 1n): ${Number(2n ** 64n + 1n)}`);
try {
  const one = 1;
  console.log(1n + one);
} catch (e) {
  console.log(`1n + 1: ${e.name}`);
}
try {
  console.log(JSON.stringify({ n: 1n }));
} catch (e) {
  console.log(`JSON.stringify({ n: 1n }): ${e.name}`);
}
console.log(`JSON with a string: ${JSON.stringify({ n: (2n ** 64n).toString() })}`);
Output
2n ** 64n: 18446744073709551616
2n ** 100n: 1267650600228229401496703205376
30!: 265252859812191058636308480000000
-7n / 2n: -3
MAX_SAFE_INTEGER + 2: 9007199254740992
BigInt(MAX_SAFE_INTEGER) + 2n: 9007199254740993
Number(2n ** 64n + 1n): 18446744073709552000
1n + 1: TypeError
JSON.stringify({ n: 1n }): TypeError
JSON with a string: {"n":"18446744073709551616"}
  • Verdict: native. A bigint literal ends in n, and the usual operators work on two bigint values.
  • A number above Number.MAX_SAFE_INTEGER loses digits, but the bigint result is exact. Number() on a large bigint rounds it.
  • / on bigint values truncates toward zero. A mix of bigint and number in one operation throws a TypeError, and so does JSON.stringify.
package main

import (
	"fmt"
	"math/big"
)

func yesNo(b bool) string {
	if b {
		return "yes"
	}
	return "no"
}

func main() {
	two := big.NewInt(2)
	fmt.Println("2^64:", new(big.Int).Exp(two, big.NewInt(64), nil))
	fmt.Println("2^100:", new(big.Int).Exp(two, big.NewInt(100), nil))
	fmt.Println("30!:", new(big.Int).MulRange(1, 30))
	z := big.NewInt(1)
	for i := 0; i < 4; i++ {
		z.Mul(z, big.NewInt(1000000))
	}
	fmt.Println("z after 4 Mul calls:", z)
	x := new(big.Int).Exp(two, big.NewInt(64), nil)
	fmt.Println("2^64 BitLen:", x.BitLen())
	fmt.Println("2^64 IsInt64:", yesNo(x.IsInt64()))
	fmt.Println("2^64 IsUint64:", yesNo(x.IsUint64()))
	r := new(big.Rat).Add(big.NewRat(1, 3), big.NewRat(1, 6))
	fmt.Println("1/3 + 1/6:", r)
}
Output
2^64: 18446744073709551616
2^100: 1267650600228229401496703205376
30!: 265252859812191058636308480000000
z after 4 Mul calls: 1000000000000000000000000
2^64 BitLen: 65
2^64 IsInt64: no
2^64 IsUint64: no
1/3 + 1/6: 1/2
  • Verdict: stdlib. math/big has Int, Rat and Float, and each operation is a method that writes its result into the receiver.
  • z.Mul(z, ...) uses z as an operand and as the result, so the loop reuses the memory of z.
  • IsInt64 and IsUint64 tell whether a value fits in a fixed-width type before a conversion.
RustGitHub
const BASE: u64 = 1_000_000_000;

fn mul_small(digits: &mut Vec<u32>, m: u32) {
    let mut carry: u64 = 0;
    for d in digits.iter_mut() {
        let t = *d as u64 * m as u64 + carry;
        *d = (t % BASE) as u32;
        carry = t / BASE;
    }
    while carry > 0 {
        digits.push((carry % BASE) as u32);
        carry /= BASE;
    }
}

fn to_text(digits: &[u32]) -> String {
    let mut s = digits[digits.len() - 1].to_string();
    for d in digits.iter().rev().skip(1) {
        s.push_str(&format!("{:09}", d));
    }
    s
}

fn main() {
    let mut f: u64 = 1;
    let mut n: u64 = 1;
    while let Some(next) = f.checked_mul(n + 1) {
        f = next;
        n += 1;
    }
    println!("largest n! in u64: {}! = {}", n, f);
    let mut g: u128 = 1;
    let mut m: u128 = 1;
    while let Some(next) = g.checked_mul(m + 1) {
        g = next;
        m += 1;
    }
    println!("largest n! in u128: {}! = {}", m, g);

    let mut fact = vec![1u32];
    for i in 1..=30 {
        mul_small(&mut fact, i);
    }
    println!("30!: {}", to_text(&fact));
    let mut p = vec![1u32];
    for _ in 0..100 {
        mul_small(&mut p, 2);
    }
    println!("2^100: {}", to_text(&p));
    let mut h = vec![1u32];
    for i in 1..=100 {
        mul_small(&mut h, i);
    }
    println!("decimal digits of 100!: {}", to_text(&h).len());
}
Output
largest n! in u64: 20! = 2432902008176640000
largest n! in u128: 34! = 295232799039604140847618609643520000000
30!: 265252859812191058636308480000000
2^100: 1267650600228229401496703205376
decimal digits of 100!: 158
  • Verdict: library. The standard library stops at u128 and i128, and the num-bigint crate gives BigUint and BigInt.
  • checked_mul returns None when the product does not fit, so the loops find the largest factorial in each type.
  • The block keeps a number as a Vec<u32> of base 10^9 digits, with the lowest digit first. That base makes the printing simple.
  • Pre-set precision. "In some languages such as REXX and ooRexx, the precision of all calculations must be set before doing a calculation."1 Python and Ruby "extend the precision automatically to prevent overflow"1.
  • Big rationals and big floats. Some libraries store "a numerator–denominator pair (rationals)"1. Go's big.Rat and GMP's rational type are examples68. A big float has a fixed precision that the program picks, so it still rounds. Go's big.Float is an example6.
  • Overflow detection. A program can keep fixed-width integers and detect overflow, then move to a bignum only when it is necessary. Wikipedia describes processors that raise an exception on overflow, after which "the operation could be restarted in software using arbitrary-precision arithmetic"1. See Integer overflow or wraparound and Integer overflow behaviour.
  • Symbolic computation. A computer algebra system keeps an expression such as π·sin(2) as an expression, which is a different method from arbitrary-precision arithmetic1.

Pitfalls

  • Precision lost on conversion. A JavaScript program that converts a large bigint to a number can lose digits: "the precision of a BigInt value may be lost when it is coerced to a Number value"4.
  • JSON. In JavaScript, "Using JSON.stringify() with any BigInt value will raise a TypeError"4. A program must convert big values to strings, or give a toJSON method, before it writes JSON.
  • Operations that are not constant-time. MDN says: "The operations supported on BigInt values are not constant-time and are thus open to timing attacks."4 Do not use a general bignum type for secret keys without a library made for cryptography.
  • A fixed-width step in the middle. A value that passes through an int or a long before it becomes a bignum can overflow first. In Java, BigInteger.valueOf(a * b) multiplies two long values before the conversion. Convert first, then multiply.
  • Unbounded input. A number that comes from a user can be very large. The CPython limit on string conversion exists for that reason2, and other languages have no such limit.

Cost

Wikipedia says that arbitrary-precision arithmetic "is considerably slower than arithmetic using numbers that fit entirely within processor registers"1, because the hardware does fixed-width arithmetic and the software must do bignum arithmetic. For N digits, addition and subtraction take O(N) time1. The school method of multiplication takes Θ(N^2) operations1. Faster methods exist: the Karatsuba algorithm reduces the work to about N^1.58 digit products9, and the Schönhage–Strassen algorithm, based on fast Fourier transforms, is faster again for very large N1. In GMP, "Different algorithms are used for different operand sizes"8. The Java documentation warns that "the algorithmic complexity of the methods of this class varies and may be superlinear in the size of the input"3.

Memory also grows with the value. Each number needs a separate allocation for its digits, so a bignum costs more memory than a value of 8 bytes even when the value is small.

A program needs bignums only when its values can leave the fixed range. Wikipedia says that in many programs "the task or the programmer can guarantee that the integer values in a specific application will not grow large enough to cause an overflow"1. A 64-bit integer is enough for a count of items or a size in bytes. Bignums are necessary for public-key cryptography, "whose algorithms commonly employ arithmetic with integers having hundreds of digits"1, in programs where "artificial limits and overflows would be inappropriate"1, and to check the results of fixed-precision calculations1.

History

IBM's first business computer, the IBM 702 of the mid-1950s, did integer arithmetic in hardware "on digit strings of any length from 1 to 511 digits"1. "The earliest widespread software implementation of arbitrary-precision arithmetic was probably that in Maclisp."1 Anatoly Karatsuba found his fast multiplication algorithm in 1960, and it was published in 19629. The first GMP release was in 19918.

References

  1. Arbitrary-precision arithmetic, Wikipedia, the introduction; Applications; Implementation issues; Pre-set precision; Implementation; History; Software libraries
  2. Built-in Types, The Python Standard Library, Numeric Types; Integer string conversion length limitation
  3. BigInteger, Java SE 27 API, the class description; API Note
  4. BigInt, MDN Web Docs, Description; Cryptography; Use within JSON
  5. BigInteger Struct, .NET API reference, Microsoft Learn, Remarks; Mutability
  6. big package, math/big, Go standard library, Overview
  7. num_bigint crate documentation, docs.rs, the crate description
  8. GNU Multiple Precision Arithmetic Library, Wikipedia, the introduction; C++ library interface
  9. Karatsuba algorithm, Wikipedia, the introduction; History

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/85VAST/text.yaml