Arbitrary-precision arithmetic

From wiki:
In computer science, arbitrary-precision arithmetic, also called bignum arithmetic, multiple-precision arithmetic, or sometimes infinite-precision arithmetic, indicates that calculations are performed on numbers whose digits of precision are limited only by the available memory of the host system.
This contrasts with the faster fixed-precision arithmetic found in most arithmetic logic unit (ALU) hardware, which typically offers between 8 and 64 bits of precision.

Examples of such libraries:

  1. GMP: GNU Multiple Precision Arithmetic Library. Wiki. GMP is a free library for arbitrary precision arithmetic, operating on signed integers, rational numbers, and floating-point numbers. There is no practical limit to the precision except the ones implied by the available memory in the machine GMP runs on. GMP has a rich set of functions, and the functions have a regular interface.
  2. mpmath: Python library for real and complex floating-point arithmetic with arbitrary precision. mpmath internally uses Python’s builtin long integers by default, but automatically switches to GMP/MPIR for much faster high-precision arithmetic if gmpy is installed. See doc for usage.

Reference

  1. https://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic#