This article's use of external links may not follow Wikipedia's policies or guidelines.(September 2022) |
This article lists libraries, applications, and other software which enable or support arbitrary-precision arithmetic.
Software that supports arbitrary precision computations:
Programming languages that support arbitrary precision computations, either built-in, or in the standard library of the language:
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.BigInt
datatype on Epic backend implements arbitrary-precision arithmetic.System.Numerics.BigInteger
, from .NET 5PrecisionEvaluate()
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.std.bigint
int
datatype implements arbitrary-precision arithmetic.Integer
datatype implements arbitrary-precision arithmetic.math/big
implements arbitrary-precision integers (Int
type), rational numbers (Rat
type), and floating-point numbers (Float
type)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.Integer
datatype implements arbitrary-precision arithmetic and the standard Data.Ratio
module implements rational numbers.Integer
datatype implements arbitrary-precision arithmetic. java.math.BigInteger
(integer), java.math.BigDecimal
Class (decimal)java.math.BigDecimal
, and libraries such as DecimalJS, BigInt and Crunch support arbitrary-precision integers.BigFloat
and BigInt
types provide arbitrary-precision floating point and integer arithmetic respectively.bignum
and bigrat
pragmas provide BigNum and BigRational support for Perl.int
type will silently change from machine-native integer to arbitrary precision as soon as the value exceeds the former's capacity.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.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.Int
and FatRat
data types that promote to arbitrary-precision integers and rationals.Bignum
integer type is of arbitrary precision. The BigDecimal
class in the standard library module bigdecimal has user definable precision.Class BigInt
and Class BigDecimal
.bigInteger
and bigRational
.bigInt
type.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.IntInf
structure implements the INTEGER signature and supports arbitrary-precision integers.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.
In computing, floating-point arithmetic (FP) is arithmetic that represents subsets of real numbers using an integer with a fixed precision, called the significand, scaled by an integer exponent of a fixed base. Numbers of this form are called floating-point numbers. For example, 12.345 is a floating-point number in base ten with five digits of precision:
In computer science, an integer is a datum of integral data type, a data type that represents some range of mathematical integers. Integral data types may be of different sizes and may or may not be allowed to contain negative values. Integers are commonly represented in a computer as a group of binary digits (bits). The size of the grouping varies so the set of integer sizes available varies between different types of computers. Computer hardware nearly always provides a way to represent a processor register or memory address as an integer.
Double-precision floating-point format is a floating-point number format, usually occupying 64 bits in computer memory; it represents a wide dynamic range of numeric values by using a floating radix point.
Standard ML (SML) is a general-purpose, modular, functional programming language with compile-time type checking and type inference. It is popular for writing compilers, for programming language research, and for developing theorem provers.
In computer science, primitive data types are a set of basic data types from which all other data types are constructed. Specifically it often refers to the limited set of data representations in use by a particular processor, which all compiled programs must use. Most processors support a similar set of primitive data types, although the specific representations vary. More generally, "primitive data types" may refer to the standard data types built into a programming language. Data types which are not primitive are referred to as derived or composite.
The IEEE Standard for Floating-Point Arithmetic is a technical standard for floating-point arithmetic established in 1985 by the Institute of Electrical and Electronics Engineers (IEEE). The standard addressed many problems found in the diverse floating-point implementations that made them difficult to use reliably and portably. Many hardware floating-point units use the IEEE 754 standard.
In computing, fixed-point is a method of representing fractional (non-integer) numbers by storing a fixed number of digits of their fractional part. Dollar amounts, for example, are often stored with exactly two fractional digits, representing the cents. More generally, the term may refer to representing fractional values as integer multiples of some fixed small unit, e.g. a fractional amount of hours as an integer multiple of ten-minute intervals. Fixed-point number representation is often contrasted to the more complicated and computationally demanding floating-point representation.
GNU Multiple Precision Arithmetic Library (GMP) is a free library for arbitrary-precision arithmetic, operating on signed integers, rational numbers, and floating-point numbers. There are no practical limits to the precision except the ones implied by the available memory (operands may be of up to 232−1 bits on 32-bit machines and 237 bits on 64-bit machines). GMP has a rich set of functions, and the functions have a regular interface. The basic interface is for C, but wrappers exist for other languages, including Ada, C++, C#, Julia, .NET, OCaml, Perl, PHP, Python, R, Ruby, and Rust. Prior to 2008, Kaffe, a Java virtual machine, used GMP to support Java built-in arbitrary precision arithmetic. Shortly after, GMP support was added to GNU Classpath.
In computer science, arbitrary-precision arithmetic, also called bignum arithmetic, multiple-precision arithmetic, or sometimes infinite-precision arithmetic, indicates that calculations are performed on numbers whose digits of precision are limited only by the available memory of the host system. This contrasts with the faster fixed-precision arithmetic found in most arithmetic logic unit (ALU) hardware, which typically offers between 8 and 64 bits of precision.
Windows Calculator is a software calculator developed by Microsoft and included in Windows. In its Windows 10 incarnation it has four modes: standard, scientific, programmer, and a graphing mode. The standard mode includes a number pad and buttons for performing arithmetic operations. The scientific mode takes this a step further and adds exponents and trigonometric function, and programmer mode allows the user to perform operations related to computer programming. In 2020, a graphing mode was added to the Calculator, allowing users to graph equations on a coordinate plane.
bc, for basic calculator, is "an arbitrary-precision calculator language" with syntax similar to the C programming language. bc is typically used as either a mathematical scripting language or as an interactive mathematical shell.
Extended precision refers to floating-point number formats that provide greater precision than the basic floating-point formats. Extended precision formats support a basic format by minimizing roundoff and overflow errors in intermediate values of expressions on the base format. In contrast to extended precision, arbitrary-precision arithmetic refers to implementations of much larger numeric types using special software.
Decimal floating-point (DFP) arithmetic refers to both a representation and operations on decimal floating-point numbers. Working directly with decimal (base-10) fractions can avoid the rounding errors that otherwise typically occur when converting between decimal fractions and binary (base-2) fractions.
This article compares a large number of programming languages by tabulating their data types, their expression, statement, and declaration syntax, and some common operating-system interfaces.
Class Library for Numbers (CLN) is a free library for arbitrary precision arithmetic. It operates on signed integers, rational numbers, floating point numbers, complex numbers, modular numbers, and univariate polynomials. Its implementation programming language is C++.
The Library of Efficient Data types and Algorithms (LEDA) is a proprietarily-licensed software library providing C++ implementations of a broad variety of algorithms for graph theory and computational geometry. It was originally developed by the Max Planck Institute for Informatics Saarbrücken. Since 2001, LEDA is further developed and distributed by the Algorithmic Solutions Software GmbH.
Some programming languages provide a complex data type for complex number storage and arithmetic as a built-in (primitive) data type.
Some programming languages provide a built-in (primitive) rational data type to represent rational numbers like 1/3 and -11/17 without rounding, and to do arithmetic on them. Examples are the ratio
type of Common Lisp, and analogous types provided by most languages for algebraic computation, such as Mathematica and Maple. Many languages that do not have a built-in rational type still provide it as a library-defined type.
PARI/GP is a computer algebra system with the main aim of facilitating number theory computations. Versions 2.1.0 and higher are distributed under the GNU General Public License. It runs on most common operating systems.
Some programming languages provide a built-in (primitive) or library decimal data type to represent non-repeating decimal fractions like 0.3 and -1.17 without rounding, and to do arithmetic on them. Examples are the decimal.Decimal
type of Python, and analogous types provided by other languages.