The 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 in the machine GMP runs on (operand dimension limit is 231 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#, OCaml, Perl, PHP, and Python. In the past, the Kaffe Java virtual machine used GMP to support Java built-in arbitrary precision arithmetic. This feature has been removed from recent releases, causing protests from people who claim that they used Kaffe solely for the speed benefits afforded by GMP. As a result, GMP support has been added to GNU Classpath.
The main target applications of GMP are cryptography applications and research, Internet security applications, and computer algebra systems.
GMP aims to be faster than any other bignum library for all operand sizes. Some important factors in doing this are:
- Using full words as the basic arithmetic type.
- Using different algorithms for different operand sizes; algorithms that are faster for very big numbers are usually slower for small numbers.
- Highly optimized assembly language code for the most important inner loops, specialized for different processors.
The first GMP release was made in 1991. It is constantly developed and maintained. As of 6 May 2012 (2012 -05-06), the release is 5.0.5.
GMP is part of the GNU project (although its website being off gnu.org may cause confusion), and is distributed under the GNU Lesser General Public License (LGPL).
GMP is used for integer arithmetic in many computer algebra systems such as Mathematica and Maple. It is also used in the Computational Geometry Algorithms Library (CGAL) because geometry algorithms tend to 'explode' when using ordinary floating point CPU math.
GMP is needed to build the GNU Compiler Collection (GCC).
Read more about GNU Multiple Precision Arithmetic Library: Example, Language Bindings
Famous quotes containing the words multiple, precision, arithmetic and/or library:
“Combining paid employment with marriage and motherhood creates safeguards for emotional well-being. Nothing is certain in life, but generally the chances of happiness are greater if one has multiple areas of interest and involvement. To juggle is to diminish the risk of depression, anxiety, and unhappiness.”
—Faye J. Crosby (20th century)
“How should the world be luckier if this house,
Where passion and precision have been one
Time out of mind, became too ruinous
To breed the lidless eye that loves the sun?”
—William Butler Yeats (18651939)
“O! O! another stroke! that makes the third.
He stabs me to the heart against my wish.
If that be so, thy state of health is poor;
But thine arithmetic is quite correct.”
—A.E. (Alfred Edward)
“Madam, a circulating library in a town is as an evergreen tree of diabolical knowledge; it blossoms through the year. And depend on it ... that they who are so fond of handling the leaves, will long for the fruit at last.”
—Richard Brinsley Sheridan (17511816)