How are infinitely large numbers represented and used like Python’s int class and Haskell’s Integer type?

This page summarizes the projects mentioned and recommended in the original post on /r/ProgrammingLanguages

SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  1. gmp-wasm

    Fork of the GNU Multiple Precision Arithmetic Library (GMP), suitable for compilation into WebAssembly.

    In C, the GMP library (aka GNU MP Bignum library) is the most well-known library in the domain. It offers unparalleled performance for arithmetic, at the cost of being fairly big.

  2. SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  3. CPython

    The Python programming language

    You can find the python implementation for big integers at "https://github.com/python/cpython/blob/main/Objects/longobject.c". In resume, big integers are stored as linear arrays of 32 bits integers on the heap, the number is stored base 230, I dont remember exactly why they let 2 bits out, but I guess there is some edge cases when doing arithmetic that need those extra bits, this base makes it easier to speedup computations using bitwise operations and base 10 is really inefficient sinse we are working with binary computers. The algorithms in the python source are taken from "The Art of Computer Programming Volume 2" Book from Donald Knuth, I have also implemented some of those algorithms on my computer algebra system, so if you are having difficulty following the python source I recomend you give a look at "https://github.com/Marcos30004347/gauss/blob/main/gauss/Algebra/Int.hpp", there you will find some extra references as well.

  4. gauss

    Symbolic Math Library (by Marcos30004347)

    You can find the python implementation for big integers at "https://github.com/python/cpython/blob/main/Objects/longobject.c". In resume, big integers are stored as linear arrays of 32 bits integers on the heap, the number is stored base 230, I dont remember exactly why they let 2 bits out, but I guess there is some edge cases when doing arithmetic that need those extra bits, this base makes it easier to speedup computations using bitwise operations and base 10 is really inefficient sinse we are working with binary computers. The algorithms in the python source are taken from "The Art of Computer Programming Volume 2" Book from Donald Knuth, I have also implemented some of those algorithms on my computer algebra system, so if you are having difficulty following the python source I recomend you give a look at "https://github.com/Marcos30004347/gauss/blob/main/gauss/Algebra/Int.hpp", there you will find some extra references as well.

  5. tomsfastmath

    TomsFastMath is a fast public domain, open source, large integer arithmetic library written in portable ISO C.

    tcl uses tomsmath.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Show HN: MLL – image compression that runs well enough on DOS

    1 project | news.ycombinator.com | 9 Jun 2026
  • Sum Type and Type Matching in C

    1 project | news.ycombinator.com | 9 Jun 2026
  • Show HN: Fable, Make Me a Crypto Blockchain Full Node Tor Onion Service P2P"

    1 project | news.ycombinator.com | 9 Jun 2026
  • Show HN: Live audit log of every command, file, network connection by Claude

    1 project | news.ycombinator.com | 9 Jun 2026
  • Zelda – Ocarina of Time (Switch 2)

    1 project | news.ycombinator.com | 9 Jun 2026

Did you know that C is
the 6th most popular programming language
based on number of references?