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

InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • 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.

  • 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.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • 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.

  • 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

  • Modos Paper Monitor Pre-Launch on Crowd Supply

    1 project | news.ycombinator.com | 20 May 2024
  • pg_timeseries: Open-source time-series extension for PostgreSQL

    2 projects | news.ycombinator.com | 20 May 2024
  • Substituindo o Redis pelo Valkey em projetos PHP/Hyperf

    2 projects | dev.to | 20 May 2024
  • HypoPG: Hypothetical Indexes for PostgreSQL

    1 project | news.ycombinator.com | 20 May 2024
  • Ubuntu 24.10 to Default to Wayland for Nvidia Users

    2 projects | news.ycombinator.com | 19 May 2024