List of arbitrary-precision arithmetic software


This article lists libraries, applications, and other software which enable or support arbitrary-precision arithmetic.

Libraries

Package-library nameNumber typeLanguageLicense
Boost Multiprecision LibraryIntegers, rationals, floats, and complexC++ and backends using GMP/MPFRBoost
Integers, floatsC++BSD
Integers, floatsCMIT
Integers, rationalsC++MIT
IntegersCGPL
GNU Multi-Precision Library Integers, rationals, and floatsC and C++ with bindingsLGPL
CLNIntegers, rationals, floats, and complexC++GPL
Integers, floats, and complexC++BSD-type
, Integers, decimal and complex floatsC Freeware
MPIR (mathematics software)Integers, rationals, and floatsC and C++ with bindingsLGPL
Integers, rationals, and floatsC++Freeware
LEDAIntegers, rationals, and floatsC++Proprietary
CGALIntegers, rationals, and floatsC++LGPL
Integers and rationalsC++Boost
IntegersCPublic Domain or WTFPL
libgcryptIntegersCLGPL
OpenSSLIntegersCApache License 2.0
FloatsCMIT License
mbed TLSIntegersCApache License 2.0 and GPL
Integers, rationals, and floatsJavaBSD-type
Integers, rationals, and complex numbersJavaLGPL
Integers, rationals, and complex numbersJavaMIT
Decimals, rationals, and complex numbersJavaLGPL
Integers, rationals, floats, and complex numbersJava, C++MIT License
Integers, rationals, floats, and complex numbersPascal, DelphiZlib
IntegersC++MPL
Integers, rationalsC BSD-type
IntegersC++GPL
Integers, rationals, and complexRustApache License 2.0
DecimalsC++MIT
FloatsRustApache License 2.0
FloatsRustMIT
IntegersCPublic Domain
Integers, rationalsANSI CMIT
Integers, rationals, naturals, floatsC MIT
Integers, naturalsCBSD
IntegersHaskell
IntegersNim
IntegersCISC
DecimalsGoBSD
Floats and complexPythonBSD
Computable RealsCommon LispBSD
Decimal floatsC and C++BSD
Floats and complex numbersMATLAB and GNU OctaveMPL
Bignums libraryIntegers, rationals, floats, and complexSnap!Unknown
Integers, reals, floatsFor.NET Framework, written in VB.NET and ML64 assemblerNon-commercial use

Stand-alone application software

Software that supports arbitrary precision computations:

Languages

Programming languages that support arbitrary precision computations, either built-in, or in the standard library of the language:
  • Ada: the upcoming Ada 202x revision adds the and packages to the standard library, providing arbitrary precision integers and real numbers.
  • Agda: the BigInt datatype on backend implements arbitrary-precision arithmetic.
  • Common Lisp: The ANSI Common Lisp standard supports arbitrary precision integer, ratio, and complex numbers.
  • C#:, from .NET 5
  • ColdFusion: the built-in PrecisionEvaluate function evaluates one or more string expressions, dynamically, from left to right, using BigDecimal precision arithmetic to calculate the values of arbitrary precision arithmetic expressions.
  • D: standard library module
  • Dart: the built-in int datatype implements arbitrary-precision arithmetic.
  • Emacs Lisp: supports integers of arbitrary size, starting with Emacs 27.1.
  • Erlang: the built-in Integer datatype implements arbitrary-precision arithmetic.
  • Go: the standard library package implements arbitrary-precision integers, rational numbers, and floating-point numbers
  • Guile: the built-in exact numbers are of arbitrary precision. Example: produces the expected result. Exact numbers also include rationals, so produces 3/4. One of the languages implemented in Guile is Scheme.
  • Haskell: the built-in Integer datatype implements arbitrary-precision arithmetic and the standard Data.Ratio module implements rational numbers.
  • Idris: the built-in Integer datatype implements arbitrary-precision arithmetic.
  • ISLISP: The ISO/IEC 13816:1997 ISLISP standard supports arbitrary precision integer numbers.
  • J: built-in extended precision
  • Java: Class, Class
  • JavaScript: as of ES2020, BigInt is supported in most browsers; the library provides an interface to java.math.BigDecimal, and libraries such as, and support arbitrary-precision integers.
  • Julia: the built-in and BigInt types provide arbitrary-precision floating point and integer arithmetic respectively.
  • newRPL: integers and floats can be of arbitrary precision ; maximum number of digits configurable
  • Nim: and multiple .
  • OCaml: The library supports arbitrary-precision integers and rationals.
  • OpenLisp: supports arbitrary precision integer numbers.
  • Perl: The and pragmas provide BigNum and BigRational support for Perl.
  • PHP: The module provides arbitrary precision mathematics.
  • PicoLisp: supports arbitrary precision integers.
  • Pike: the built-in int type will silently change from machine-native integer to arbitrary precision as soon as the value exceeds the former's capacity.
  • Prolog: ISO standard compatible Prolog systems can check the Prolog flag "bounded". Most of the major Prolog systems support arbitrary precision integer numbers.
  • Python: the built-in int / long integer type is of arbitrary precision. The Decimal class in the standard library module decimal has user definable precision and limited mathematical operations. The Fraction class in the module fractions implements rational numbers. More extensive arbitrary precision floating point arithmetic is available with the third-party "mpmath" and "bigfloat" packages.
  • Racket: the built-in exact numbers are of arbitrary precision. Example: produces the expected result. Exact numbers also include rationals, so produces 3/4. Arbitrary precision floating point numbers are included in the standard library module.
  • Raku: Rakudo supports and data types that promote to arbitrary-precision integers and rationals.
  • Rexx: variants including Open Object Rexx and NetRexx
  • RPL : calculator treats numbers entered without decimal point as integers rather than floats; integers are of arbitrary precision only limited by the available memory.
  • Ruby: the built-in Bignum integer type is of arbitrary precision. The BigDecimal class in the standard library module bigdecimal has user definable precision.
  • Scheme: R5RS encourages, and R6RS requires, that exact integers and exact rationals be of arbitrary precision.
  • Scala: and .
  • Seed7: and .
  • Self: arbitrary precision integers are supported by the built-in bigInt type.
  • Smalltalk: variants including Squeak, Smalltalk/X, GNU Smalltalk, Dolphin Smalltalk, etc.
  • , a free programming language with integrated development environment for mathematical calculations. Variables of BigNumber type can be used, or regular numbers can be converted to big numbers using conversion operator #. SmartXML big numbers can have up to 100,000,000 decimal digits and up to 100,000,000 whole digits.
  • Standard ML: The optional built-in structure implements the INTEGER signature and supports arbitrary-precision integers.
  • Tcl: As of version 8.5, integers are arbitrary-precision by default.
  • Wolfram Language, like Mathematica, employs GMP for approximate number computation.

Online calculators

For one-off calculations. Runs on server or in browser. No installation or compilation required.
  • 1. https://www.mathsisfun.com/calculator-precision.html 200 places
  • 2. http://birrell.org/andrew/ratcalc/ arbitrary; select rational or fixed-point and number of places
  • 3. PARI/GP online calculator - https://pari.math.u-bordeaux.fr/gp.html
  • 4.1. - allow users to Search, Create, Store and Share multi-step calculations using explicit expressions featuring automated Unit Conversion. It is a platform that allows users to go beyond unit conversion, which in turn brings in significantly improved efficiency. A lot of sample calculations can be found at AutoCalcs Docs site. Calculations created with AutoCalcs can be embedded into 3rd party websites.
  • 4.2. - considering above mentioned as the calculation engine, this Docs site is a library with a host of calculations, where each calculation is essentially a web app that can run online, be further customized, and much more. Imaging reading a book with a lot of calculations, then this is the book/manual with all calculations that can be used on the fly. It is worthwhile to mention - when units are involved in the calculations, the unit conversion can be automated.
  • 5. : an arbitrary precision integer and decimal calculator, with support for decimal shifting and data type fitting.