This article lists libraries, applications, and other software which enable or support arbitrary-precision arithmetic.
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.
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.
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.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.)
For one-off calculations. Runs on server or in browser. No installation or compilation required.