List of arbitrary-precision arithmetic software explained

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
TTMathIntegers, floatsC++BSD
LibBFIntegers, floatsCMIT
BeeNumIntegers, rationalsC++MIT
longer-intIntegersCGPL
GNU Multi-Precision Library (and MPFR)Integers, rationals, and floatsC and C++ with bindingsLGPL
CLNIntegers, rationals, floats, and complexC++GPL
ARPRECIntegers, floats, and complexC++BSD-type
MAPM, MAPMIntegers, decimal and complex floatsC (bindings for C++)Freeware
MPIR (mathematics software)Integers, rationals, and floatsC and C++ with bindingsLGPL
COREIntegers, rationals, and floatsC++Freeware
LEDAIntegers, rationals, and floatsC++Freeware
CGALIntegers, rationals, and floatsC++LGPL
GeometricToolsIntegers and rationalsC++Boost
LibTomMathIntegersCPublic Domain or WTFPL (dual-licensed)
libgcryptIntegersCLGPL
OpenSSLIntegersCApache License v2
ArbitraireFloatsCMIT License
mbed TLSIntegersCApache License v2 and GPL
JScienceIntegers, rationals, and floatsJavaBSD-type
JASIntegers, rationals, and complex numbersJavaLGPL
Big-MathIntegers, rationals, and complex numbersJavaMIT
JLinAlgDecimals, rationals, and complex numbersJavaLGPL
ApfloatIntegers, rationals, floats, and complex numbersJava, C++MIT License
MPArithIntegers, rationals, floats, and complex numbersPascal, DelphiZlib
InfIntIntegersC++MPL
bigzIntegers, rationalsC (bindings for C++)BSD-type
C++ BigInt ClassIntegersC++GPL
numIntegers, rationals, and complexRustApache License v2
floatFloatsRustApache License v2
astro-floatFloatsRustMIT
fgmpIntegersCPublic Domain
imathIntegers, rationalsANSI CMIT
hebimathIntegers, rationals, naturals, floatsC (C99)MIT
bsdntIntegers, naturalsCBSD (2-clause)
integer-simpleIntegersHaskellBSD (3-clause)
bigintsIntegersNimMIT
libzahl (WIP)IntegersCISC
decimalDecimalsGoBSD (3-clause)
mpmathFloats and complexPythonBSD
Computable RealsComputable RealsCommon LispBSD (3-clause)
libmpdec and libmpdec++Decimal floatsC and C++BSD (2-clause)
GEM LibraryFloats and complex numbersMATLAB and GNU OctaveMPL
Bignums libraryIntegers, rationals, floats, and complexSnap!Unknown
HyperIntegers, reals, floatsFor .NET Framework, written in VB.NET and ML64 assemblerNon-commercial use

Stand-alone application software

Software that supports arbitrary precision computations:

"Desktop Calculator" arbitrary-precision RPN calculator that comes standard on most Unix-like systems.

a computer algebra system which bignum integers are directly inherited from its implementation language Common Lisp. In addition, it supports arbitrary-precision floating-point numbers, bigfloats.

Languages

Programming languages that support arbitrary precision computations, either built-in, or in the standard library of the language:

the upcoming Ada 202x revision adds the Ada.Numerics.Big_Numbers.Big_Integers and Ada.Numerics.Big_Numbers.Big_Reals packages to the standard library, providing arbitrary precision integers and real numbers.

the BigInt datatype on Epic backend implements arbitrary-precision arithmetic.

The ANSI Common Lisp standard supports arbitrary precision integer, ratio, and complex numbers.

System.Numerics.BigInteger, from .NET 5

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.

standard library module std.bigint

the built-in int datatype implements arbitrary-precision arithmetic.

supports integers of arbitrary size, starting with Emacs 27.1.

the built-in Integer datatype implements arbitrary-precision arithmetic.

the standard library package math/big implements arbitrary-precision integers (Int type), rational numbers (Rat type), and floating-point numbers (Float type)

the built-in exact numbers are of arbitrary precision. Example: (expt 10 100) produces the expected (large) result. Exact numbers also include rationals, so (/ 3 4) produces 3/4. One of the languages implemented in Guile is Scheme.

the built-in Integer datatype implements arbitrary-precision arithmetic and the standard Data.Ratio module implements rational numbers.

the built-in Integer datatype implements arbitrary-precision arithmetic.

The ISO/IEC 13816:1997(E) ISLISP standard supports arbitrary precision integer numbers.

built-in extended precision

Class (integer), Class (decimal)

as of ES2020, BigInt is supported in most browsers;[1] the [//code.google.com/p/gwt-math/ gwt-math] library provides an interface to java.math.BigDecimal, and libraries such as DecimalJS, BigInt and Crunch support arbitrary-precision integers.

the built-in BigFloat and BigInt types provide arbitrary-precision floating point and integer arithmetic respectively.

integers and floats can be of arbitrary precision (up to at least 2000 digits); maximum number of digits configurable (default 32 digits)

bigints and multiple GMP bindings.

The Num library supports arbitrary-precision integers and rationals.

supports arbitrary precision integer numbers.

The bignum and bigrat pragmas provide BigNum and BigRational support for Perl.

The [//php.net/manual/en/book.bc.php BC Math] module provides arbitrary precision mathematics.

supports arbitrary precision integers.

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.

ISO standard compatible Prolog systems can check the Prolog flag "bounded". Most of the major Prolog systems support arbitrary precision integer numbers.

the built-in int (3.x) / long (2.x) integer type is of arbitrary precision. The Decimal class in the standard library module decimal has user definable precision and limited mathematical operations (exponentiation, square root, etc. but no trigonometric functions). 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.

the built-in exact numbers are of arbitrary precision. Example: (expt 10 100) produces the expected (large) result. Exact numbers also include rationals, so (/ 3 4) produces 3/4. Arbitrary precision floating point numbers are included in the standard library math/bigfloat module.

Rakudo supports [//doc.perl6.org/type/Int <code>Int</code>] and [//doc.perl6.org/type/FatRat <code>FatRat</code>] data types that promote to arbitrary-precision integers and rationals.

variants including Open Object Rexx and NetRexx

the built-in Bignum integer type is of arbitrary precision. The BigDecimal class in the standard library module bigdecimal has user definable precision.

R5RS encourages, and R6RS requires, that exact integers and exact rationals be of arbitrary precision.

Class BigInt and Class BigDecimal.

bigInteger and bigRational.

arbitrary precision integers are supported by the built-in bigInt type.

variants including Squeak, Smalltalk/X, GNU Smalltalk, Dolphin Smalltalk, etc.

The optional built-in IntInf structure implements the INTEGER signature and supports arbitrary-precision integers.

As of version 8.5 (2007), integers are arbitrary-precision by default. (Behind the scenes, the language switches to using an arbitrary-precision internal representation for integers too large to fit in a machine word. Bindings from C should use library functions such as Tcl_GetLongFromObj to get values as C-native data types from Tcl integers.)

Online calculators

For one-off calculations. Runs on server or in browser. No installation or compilation required.

Notes and References

  1. Web site: BigInt . Can I use . 2021-03-16.