Jump to content

List of arbitrary-precision arithmetic software

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by 85.65.151.16 (talk) at 05:10, 6 April 2016 (Added info about C++ BigInt class). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

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 and floats C++ and backends using GMP/MPFR Boost
TTMath Integers, floats and complex C++ BSD
GNU Multi-Precision Library (and MPFR) Integers, rationals and floats C and C++ with bindings LGPL
CLN Integers, rationals, floats and complex C++ GPL
MAPM Integers, decimal and complex floats C (bindings for C++) Freeware
MPIR (mathematics software) Integers, rationals and floats C and C++ with bindings LGPL
LibTomMath Integers C Public Domain or WTFPL (dual-licensed)
libgcrypt Integers C LGPL
OpenSSL Integers C BSD-type
JScience Integers, rationals and floats Java BSD-type
JAS Integers, rationals and complex numbers Java LGPL
JLinAlg Decimals, rational numbers and complex numbers Java LGPL
Apfloat Integers, rationals, floats and complex numbers Java, C++ LGPL
InfInt Integers C++ LGPL
bigz Integers, rationals C (bindings for C++) BSD-type
C++ BigInt Class Integers C++ GPL


Stand-alone application software

Software that supports arbitrary precision computations:

Languages

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

  • Agda: the BigInt datatype on Epic backend implements arbitrary-precision arithmetic.
  • Common Lisp: The ANSI Common Lisp standard supports arbitrary precision integer, ratio and complex numbers.
  • C#: System.Numerics.BigInteger, 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 std.bigint
  • Dart: the built-in int datatype implements arbitrary-precision arithmetic.
  • Erlang: the built-in Integer datatype implements arbitrary-precision arithmetic.
  • Go: the standard library package math/big implements arbitrary-precision integers (Int type) and rational numbers (Rat type)
  • 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 java.math.BigInteger (integer), Class java.math.BigDecimal (decimal)
  • JavaScript: the gwt-math library provides an interface to java.math.BigDecimal, and libraries such as BigInt and Crunch support arbitrary-precision integers.
  • Julia: the built-in "BigFloat" and "BigInt" types provide arbitrary-precision floating point and integer arithmetic respectively.
  • OCaml: The Num library supports arbitrary-precision integers and rationals.
  • OpenLisp: supports arbitrary precision integer numbers.
  • Perl: The bignum and bigrat pragmas provide BigNum and BigRational support for Perl.
  • Perl6: Rakudo supports Int and FatRat data types that promote to arbitrary-precision integers and rationals.
  • PHP: The BC Math module provides arbitrary precision mathematics.
  • 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.
  • 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.
  • Rexx: variants including Open Object Rexx and NetRexx
  • 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: Class BigInt and Class BigDecimal.
  • Seed7: bigInteger and bigRational.
  • Smalltalk: variants including Squeak, Smalltalk/X, GNU Smalltalk, Dolphin Smalltalk, etc.
  • Standard ML: The optional built-in IntInf structure implements the INTEGER signature and supports arbitrary-precision integers.
  • Wolfram Language, like Mathematica, employs GMP for approximate number computation.