List of arbitrary-precision arithmetic software
This article lists libraries, applications, and other software which enable or support arbitrary-precision arithmetic.
Libraries
Package-library name | Number type | Language | License |
Boost Multiprecision Library | Integers, rationals, floats, and complex | C++ and backends using GMP/MPFR | Boost |
Integers, floats | C++ | BSD | |
Integers, floats | C | MIT | |
Integers | C | GPL | |
GNU Multi-Precision Library | Integers, rationals, and floats | C and C++ with bindings | LGPL |
CLN | Integers, rationals, floats, and complex | C++ | GPL |
Integers, floats, and complex | C++ | BSD-type | |
, | Integers, decimal and complex floats | C | Freeware |
MPIR | Integers, rationals, and floats | C and C++ with bindings | LGPL |
Integers, rationals, and floats | C++ | Freeware | |
LEDA | Integers, rationals, and floats | C++ | Freeware |
CGAL | Integers, rationals, and floats | C++ | LGPL |
Integers and rationals | C++ | Boost | |
Integers | C | Public Domain or WTFPL | |
libgcrypt | Integers | C | LGPL |
OpenSSL | Integers | C | |
Floats | C | MIT License | |
mbed TLS | Integers | C | Apache License v2 and GPL |
Integers, rationals, and floats | Java | BSD-type | |
Integers, rationals, and complex numbers | Java | LGPL | |
Decimals, rationals, and complex numbers | Java | LGPL | |
Integers, rationals, floats, and complex numbers | Java, C++ | LGPL | |
Integers, rationals, floats, and complex numbers | Pascal, Delphi | Zlib | |
Integers | C++ | MPL | |
Integers, rationals | C | BSD-type | |
Integers | C++ | GPL | |
Integers | Rust | Apache License v2 | |
Floats | Rust | Apache License v2 | |
Integers | C | Public Domain | |
Integers, rationals | ANSI C | MIT | |
Integers, rationals, naturals, floats | C | MIT | |
Integers, naturals | C | BSD | |
Integers | Haskell | ||
Integers | Nim | ||
Integers | C | ISC | |
Decimals | Go | BSD | |
Floats and complex | Python | BSD | |
Integers, rationals | PHP, C# | MIT License | |
Computable Reals | Common Lisp |
Stand-alone application software
Software that supports arbitrary precision computations:- bc the POSIX arbitrary-precision arithmetic language that comes standard on most Unix-like systems.
- *dc: "Desktop Calculator" arbitrary-precision RPN calculator that comes standard on most Unix-like systems.
- KCalc, Linux based scientific calculator
- Maxima: 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.
- Maple, Mathematica, and several other computer algebra software include arbitrary-precision arithmetic. Mathematica employs GMP for approximate number computation.
- PARI/GP, an open source computer algebra system that supports arbitrary precision.
- SageMath, an open-source computer algebra system
- SymPy, a CAS
- Symbolic Math toolbox
- , 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.
- *The SmartXML program file editor supports code completion and most typing is replaced by code completion. Only minimal typing is required when writing a program. Other than constant values, such as 5 or 'Some Text', everything else is supported by code completion.
- *Operations with big numbers are done using operators, such as +, -, *, /, ^, etc..
- *SmartXML maintains pool of big numbers, from which big numbers are retrieved, and the numbers are released back to the pool, when a big number goes out of scope. The programmer does not have to worry about retrieving or releasing big numbers, since it is done internally by SmartXML.
- Windows Calculator, since Windows 98, uses arbitrary precision for basic operations and 32 digits of precision for advanced operations.
Languages
- 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 Framework 4.0
- 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: ,
- JavaScript: 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.
- Raku: 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
- https://apfloat.appspot.com/ arbitrary
- https://www.mathsisfun.com/calculator-precision.html 200 places
- http://birrell.org/andrew/ratcalc/ arbitrary; select rational or fixed-point and number of places