List of arbitrary-precision arithmetic software

Last updated

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

Contents

Libraries

Package-library nameNumber typeLanguageLicense
Boost Multiprecision Library Integers, rationals, floats, and complex C++ and backends using GMP/MPFR Boost
TTMath Integers, floats C++ BSD
LibBF Integers, floats C MIT
BeeNum Integers, rationals C++ MIT
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 complexC++ GPL
ARPREC Integers, floats, and complexC++ BSD-type
MAPM, MAPM Integers, decimal and complex floats C (bindings for C++) Freeware
MPIR (mathematics software) Integers, rationals, and floats C and C++ with bindings LGPL
CORE Integers, rationals, and floats C++ Freeware
LEDA Integers, rationals, and floats C++ Freeware
CGAL Integers, rationals, and floats C++ LGPL
GeometricTools Integers and rationals C++ Boost
LibTomMath Integers C Public Domain or WTFPL (dual-licensed)
libgcrypt Integers CLGPL
OpenSSL Integers C Apache License v2
Arbitraire Floats C MIT License
mbed TLS Integers C Apache License v2 and GPL
JScience Integers, rationals, and floats Java BSD-type
JAS Integers, rationals, and complex numbersJava LGPL
Big-Math Integers, rationals, and complex numbersJava MIT
JLinAlg Decimals, rationals, and complex numbersJava LGPL
Apfloat Integers, rationals, floats, and complex numbersJava, C++ MIT License
MPArith Integers, rationals, floats, and complex numbers Pascal, Delphi Zlib
InfInt Integers C++ MPL
bigz Integers, rationals C (bindings for C++) BSD-type
C++ BigInt Class Integers C++ GPL
num Integers, rationals, and complex Rust Apache License v2
float Floats Rust Apache License v2
astro-float Floats Rust MIT
fgmp Integers C Public Domain
imath Integers, rationals ANSI C MIT
hebimath Integers, rationals, naturals, floats C (C99) MIT
bsdnt Integers, naturalsC BSD (2-clause)
integer-simple Integers Haskell BSD (3-clause)
bigints Integers Nim MIT
libzahl (WIP) Integers C ISC
decimal Decimals Go BSD (3-clause)
mpmath Floats and complex Python BSD
Computable Reals Computable Reals Common Lisp BSD (3-clause)
libmpdec and libmpdec++ Decimal floats C and C++ BSD (2-clause)
GEM Library Floats and complex numbers MATLAB and GNU Octave MPL
Bignums library Integers, rationals, floats, and complex Snap! Unknown
Hyper Integers, reals, floatsFor .NET Framework, written in VB.NET and ML64 assemblerNon-commercial use

Stand-alone application software

Software that supports arbitrary precision computations:

Languages

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

Online calculators

For one-off calculations. Runs on server or in browser. No installation or compilation required.

Related Research Articles

<span class="mw-page-title-main">Floating-point arithmetic</span> Computer approximation for real numbers

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.

<span class="mw-page-title-main">GNU Multiple Precision Arithmetic Library</span> Free software

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.

<span class="mw-page-title-main">Windows Calculator</span> Calculator application included in Microsoft Windows

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.

<span class="mw-page-title-main">PARI/GP</span> Computer algebra system

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.

References

  1. "BigInt". Can I use. Retrieved 2021-03-16.