The GNU Multiple Precision (GMP) Library
<Text-field style="Heading 2" layout="Heading 2" bookmark="info">Description</Text-field>
The GNU Multiple Precision (GMP) library is a portable library written in C (with some routines written in assembly code) for arbitrary precision arithmetic on integers, rational numbers, and floating-point numbers. Maple uses the GMP library for integer arithmetic when operands are greater than kernelopts(maximmediate).
The GMP library is useful for doing multiple precision arithmetic quickly. The GMP speed is achieved using fullwords as the basic arithmetic type and sophisticated algorithms, and including optimized assembly code for the most common inner loops for many different CPUs. Maple is significantly faster for long integer arithmetic using the GMP library.
The Maple commands that directly benefit from the GMP library are the following.
+ (addition)- (subtraction)* (multiplication)/ (division)^ (exponentiation)iquo (quotient)irem (remainder)isqrt (square root)igcd (greatest common divisor)ilcm (least common multiple)! (factorial)isprime (primality test)
The following Maple commands indirectly benefit from the GMP because they use the previous commands extensively.
addmulmodnextprimeprevprimeithprimetruncroundfracfloorceilifactor
The GMP library is distributed under the terms of the GNU Lesser General Public License Version 3. In accordance with this license, the version of the GMP source code that Maple uses is available for download at http://www.maplesoft.com/support/downloads/GMP.html. A copy of the license file is included (see "COPYING.LIB").
See AlsoaddArithmetic Operationsceilcopyrightexamples/GMPfactorialfracigcdilcmiquoiremisprimeisqrtkerneloptsmodprevprimetrunc