List of arbitrary-precision arithmetic software

{{Short description|none}}

{{External links|date=September 2022}}

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

Libraries

class="sortable wikitable"
Package-library name

!Number type

!Language

!License

Boost Multiprecision Library

|Integers, rationals, floats, and complex

|C++ and backends using GMP/MPFR

|Boost

[https://www.ttmath.org/ TTMath]

|Integers, floats

|C++

|BSD

[https://bellard.org/libbf/ LibBF]

|Integers, floats

|C

|MIT

[https://github.com/tigertv/BeeNum BeeNum]

|Integers, rationals

|C++

|MIT

[https://github.com/vlad-olteanu/longer-int longer-int]

|Integers

|C

|GPL

GNU Multi-Precision Library (and MPFR)

|Integers, rationals, and floats

|C and C++ with bindings

|LGPL

CLN

|Integers, rationals, floats, and complex

|C++

|GPL

[http://crd-legacy.lbl.gov/~dhbailey/mpdist/ ARPREC]

|Integers, floats, and complex

|C++

|BSD-type

[https://github.com/LuaDist/mapm MAPM], [http://gnuwin32.sourceforge.net/packages/mapm.htm MAPM]

|Integers, decimal and complex floats

|C (bindings for C++)

|Freeware

MPIR (mathematics software)

|Integers, rationals, and floats

|C and C++ with bindings

|LGPL

[https://cs.nyu.edu/exact/core_pages/index.html CORE]

|Integers, rationals, and floats

|C++

|Freeware

LEDA

|Integers, rationals, and floats

|C++

|Freeware

CGAL

|Integers, rationals, and floats

|C++

|LGPL

[https://www.geometrictools.com/ GeometricTools]

|Integers and rationals

|C++

|Boost

[http://www.libtom.net/ LibTomMath]

|Integers

|C

|Public Domain or WTFPL (dual-licensed)

libgcrypt

|Integers

|C

|LGPL

OpenSSL

|Integers

|C

|Apache License 2.0{{Cite web |title=OpenSSL 3.0 Has Been Released! |url=https://openssl-library.org/post/2021-09-06-openssl3.final/ |date=Sep 7, 2021 |access-date=2024-10-11 |website=OpenSSL Blog}}

[https://github.com/hlibc/arbitraire Arbitraire]

|Floats

|C

|MIT License

mbed TLS

|Integers

|C

|Apache License 2.0 and GPL

[http://jscience.org/ JScience]

|Integers, rationals, and floats

Java

|BSD-type

[http://krum.rz.uni-mannheim.de/jas JAS]

|Integers, rationals, and complex numbers

|Java

|LGPL

[https://github.com/eobermuhlner/big-math Big-Math]

|Integers, rationals, and complex numbers

|Java

|MIT

[http://jlinalg.sourceforge.net JLinAlg]

|Decimals, rationals, and complex numbers

|Java

|LGPL

[http://www.apfloat.org/ Apfloat]

|Integers, rationals, floats, and complex numbers

|Java, C++

|MIT License

[https://github.com/JulStrat/MPArith MPArith]

|Integers, rationals, floats, and complex numbers

|Pascal, Delphi

|Zlib

[https://sercantutar.github.io/infint/ InfInt]

|Integers

|C++

|MPL

[https://sourceforge.net/projects/bigz bigz]

|Integers, rationals

|C (bindings for C++)

|BSD-type

[https://sourceforge.net/projects/cpp-bigint C++ BigInt Class]

|Integers

|C++

|GPL

[https://github.com/rust-num/num num]

|Integers, rationals, and complex

|Rust

|Apache License 2.0

[https://github.com/giocip/HEADERONLY_num7 num7]

|Decimals

|C++

|MIT

[https://github.com/huonw/float float]

|Floats

|Rust

|Apache License 2.0

[https://github.com/stencillogic/astro-float astro-float]

|Floats

|Rust

|MIT

[https://stuff.mit.edu/afs/sipb/project/stk/src/STk-2.2.0/Mp/fgmp-1.0b5/ fgmp]

|Integers

|C

|Public Domain

[https://github.com/creachadair/imath imath]

|Integers, rationals

|ANSI C

|MIT

[https://github.com/suiginsoft/hebimath hebimath]

|Integers, rationals, naturals, floats

|C (C99)

|MIT

[https://github.com/wbhart/bsdnt bsdnt]

|Integers, naturals

|C

BSD (2-clause)
[https://ghc.haskell.org/trac/ghc/wiki/ReplacingGMPNotes integer-simple]

|Integers

|Haskell

|[http://git.haskell.org/packages/integer-simple.git/blob_plain/HEAD:/LICENSE BSD] (3-clause)

[https://github.com/def-/nim-bigints bigints]

|Integers

|Nim

|[https://github.com/def-/nim-bigints/blob/master/bigints.nimble MIT]

[https://libs.suckless.org/libzahl libzahl] [https://suckless.org/sucks/ (WIP)]

|Integers

|C

|ISC

[https://github.com/ericlagergren/decimal decimal]

|Decimals

|Go

|BSD (3-clause)

[http://mpmath.org/ mpmath]

|Floats and complex

|Python

|BSD

[https://github.com/stylewarning/computable-reals Computable Reals]

|Computable Reals

|Common Lisp

|BSD (3-clause)

[https://www.bytereef.org/mpdecimal/index.html libmpdec and libmpdec++]

|Decimal floats

|C and C++

|BSD (2-clause)

[https://gem-library.github.io GEM Library]

|Floats and complex numbers

|MATLAB and GNU Octave

|MPL

Bignums library

|Integers, rationals, floats, and complex

|Snap!

|Unknown

[https://marketplace.visualstudio.com/items?itemName=SilverfoxSystems0.Hyper Hyper]

|Integers, reals, floats

|For .NET Framework, written in VB.NET and ML64 assembler

|Non-commercial use

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.
  • Qalculate!, an open-source free software arbitrary precision calculator with autocomplete.
  • SageMath, an open-source computer algebra system
  • SymPy, a CAS
  • Symbolic Math toolbox (MATLAB)
  • Windows Calculator, since Windows 98, uses arbitrary precision for basic operations (addition, subtraction, multiplication, division) and 32 digits of precision for advanced operations (square root, transcendental functions).
  • [http://oroptimizer.com/smartxml SmartXML], a free programming language with integrated development environment (IDE) for mathematical calculations. Variables of BigNumber type can be used, or regular numbers can be converted to big numbers using conversion operator # (e.g., #2.3^2000.1). SmartXML big numbers can have up to 100,000,000 decimal digits and up to 100,000,000 whole digits.

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 [http://ada-auth.org/standards/2xrm/html/RM-A-5-6.html Ada.Numerics.Big_Numbers.Big_Integers] and [http://ada-auth.org/standards/2xrm/html/RM-A-5-7.html Ada.Numerics.Big_Numbers.Big_Reals] packages to the standard library, providing arbitrary precision integers and real numbers.
  • Agda: the BigInt datatype on [https://web.archive.org/web/20120722024513/http://www.cs.st-andrews.ac.uk/~eb/epic.php Epic] backend implements arbitrary-precision arithmetic.
  • Common Lisp: The ANSI Common Lisp standard supports arbitrary precision integer, ratio, and complex numbers.
  • C#: [https://docs.microsoft.com/en-us/dotnet/api/system.numerics.biginteger?view=net-5.0 System.Numerics.BigInteger], 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 [http://dlang.org/phobos/std_bigint.html std.bigint]
  • 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 [http://golang.org/pkg/math/big/ math/big] implements arbitrary-precision integers (Int type), rational numbers (Rat type), and floating-point numbers (Float type)
  • Guile: 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.
  • 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(E) ISLISP standard supports arbitrary precision integer numbers.
  • J: built-in extended precision
  • Java: Class {{Javadoc:SE|package=java.math|java/math|BigInteger}} (integer), {{Javadoc:SE|package=java.math|java/math|BigDecimal}} Class (decimal)
  • JavaScript: as of ES2020, BigInt is supported in most browsers;{{cite web |url=https://caniuse.com/bigint |title=BigInt |website=Can I use |access-date=2021-03-16}} the [//code.google.com/p/gwt-math/ gwt-math] library provides an interface to java.math.BigDecimal, and libraries such as [https://mikemcl.github.io/decimal.js/ DecimalJS], [https://archive.today/20130127215203/http://leemon.com/crypto/BigInt.html BigInt] and [http://crunch.secureroom.net/ Crunch] support arbitrary-precision integers.
  • Julia: the built-in [http://docs.julialang.org/en/release-0.2/stdlib/base/#bigfloats BigFloat] and BigInt types provide arbitrary-precision floating point and integer arithmetic respectively.
  • newRPL: integers and floats can be of arbitrary precision (up to at least 2000 digits); maximum number of digits configurable (default 32 digits)
  • Nim: [https://github.com/def-/nim-bigints bigints] and multiple [https://nimble.directory/search?query=GMP GMP bindings].
  • OCaml: The [https://github.com/ocaml/num/ Num] library supports arbitrary-precision integers and rationals.
  • OpenLisp: supports arbitrary precision integer numbers.
  • Perl: The [http://perldoc.perl.org/bignum.html bignum] and [http://perldoc.perl.org/bigrat.html bigrat] pragmas provide BigNum and BigRational support for Perl.
  • PHP: The [//php.net/manual/en/book.bc.php BC Math] 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 (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.
  • Racket: 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 [https://docs.racket-lang.org/math/bigfloat.html math/bigfloat] module.
  • Raku: Rakudo supports [//doc.perl6.org/type/Int Int] and [//doc.perl6.org/type/FatRat FatRat] data types that promote to arbitrary-precision integers and rationals.
  • Rexx: variants including Open Object Rexx and NetRexx
  • RPL (only on HP 49/50 series in exact mode): 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: [http://www.scala-lang.org/api/current/index.html#scala.math.BigInt Class BigInt] and [http://www.scala-lang.org/api/current/index.html#scala.math.BigDecimal Class BigDecimal].
  • Seed7: [http://seed7.sourceforge.net/manual/types.htm#bigInteger bigInteger] and [http://seed7.sourceforge.net/manual/types.htm#bigRational bigRational].
  • Self: arbitrary precision integers are supported by the built-in bigInt type.
  • Smalltalk: variants including Squeak, Smalltalk/X, GNU Smalltalk, Dolphin Smalltalk, etc.
  • [http://oroptimizer.com/smartxml SmartXML], a free programming language with integrated development environment (IDE) for mathematical calculations. Variables of BigNumber type can be used, or regular numbers can be converted to big numbers using conversion operator # (e.g., #2.3^2000.1). 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 [http://www.standardml.org/Basis/int-inf.html IntInf] structure implements the INTEGER signature and supports arbitrary-precision integers.
  • Tcl: 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.)
  • 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 (PARI/GP is a widely used computer algebra system designed for fast computations in number theory (factorizations, algebraic number theory, elliptic curves, modular forms, L functions...), but also contains a large number of other useful functions to compute with mathematical entities such as matrices, polynomials, power series, algebraic numbers etc., and a lot of transcendental functions. PARI is also available as a C library to allow for faster computations.)
  • 4.1. [https://v2.donwen.com/ AutoCalcs] - 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. [https://v2-docs.donwen.com/ AutoCalcs Docs] - considering above mentioned [https://v2.donwen.com/ AutoCalcs] 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.

References

{{Reflist}}

{{DEFAULTSORT:Arbitrary precision arithmetic software}}

Category:Lists of software

Category:Computer arithmetic