Next: BSD-MP, Up: ENT Basics [Contents][Index]
The GMP library is the most widely used library of its kind, and probably the most versatile and powerful library for high precision arithmetic. Hence SXEmacs will extensively support this library in its ENT system. Also, many other libraries and pseudo-implementations are based on GMP. That is why it is probably worth fetching and installing it.
The term multi-precision arithmetic, also called arbitrary-precision arithmetic, is used to mean that the number of digits of handled numbers is not limited in any way. Practically of course it is limited by the amount of virtual memory and, more often these days, by time.
GMP is distributed under the GNU LGPL and the library is available at http://swox.com/gmp. Please refer also to their documentation, and especially their instructions on how to install it.
The GMP library consists of roughly 4 parts, MPN, MPZ, MPQ, and MPF. Only the latter three are intended for consumption.
MPN is sort of the spine of GMP and provides the actual implementation of the multi-precision arithmetic. It is not further interesting for SXEmacs since MPN functions are never accessed directly.
MPZ is a higher level interface to arbitrary precision integer arithmetic. The name is derived from the mathematical symbol for integral numbers Z. We will also use the term rational integers to refer to the mathematical concept of Z. In turn, historically Z is derived from the German word “Zahlen” which stands for “numbers”.
MPQ is the interface to rational numbers. The name is derived from the mathematical symbol for the rational field Q. Rational numbers, also referred to as fractions of integers or quotients of integers, or (if the meaning is clear) simply fractions and quotients respectively. This nomenclature already suggests how rationals can be represented, namely by two MPZ integers written in the form ‘a/b’. In such a representation we call ‘a’ the numerator and ‘b’ the denominator of ‘a/b’. Internally, a fraction is always stored in its canonical form, that is the fraction is cancelled as far as possible, such that ‘a’ and ‘b’ are coprime. For reasons of compatibility to XEmacs 21.5, we will also refer to fractions as ratios.
MPF is an interface to multi-precision floats. They are implemented like ordinary floats but are not limited to fixed number of mantissa and exponent bits. These numbers may vary instead and is called the precision of such a number. The precision in turn does not need to be a multiple of 4 or 8 or something similar and is measured in bits. In this sense, MPF numbers may be regarded as an approximation for real numbers, see Unions of Number Types.
Next: BSD-MP, Up: ENT Basics [Contents][Index]