177c97eb1237be1f5aea8d08b3e8b9b885e6d7d8
[ghc-hetmet.git] / rts / gmp / README
1
2                         THE GNU MP LIBRARY
3
4
5 GNU MP is a library for arbitrary precision arithmetic, operating on signed
6 integers, rational numbers, and floating point numbers.  It has a rich set of
7 functions, and the functions have a regular interface.
8
9 GNU MP is designed to be as fast as possible, both for small operands and huge
10 operands.  The speed is achieved by using fullwords as the basic arithmetic
11 type, by using fast algorithms, with carefully optimized assembly code for the
12 most common inner loops for lots of CPUs, and by a general emphasis on speed
13 (instead of simplicity or elegance).
14
15 GNU MP is believed to be faster than any other similar library.  Its advantage
16 increases with operand sizes for certain operations, since GNU MP in many
17 cases has asymptotically faster algorithms.
18
19 GNU MP is free software and may be freely copied on the terms contained in the
20 files COPYING.LIB and COPYING (most of GNU MP is under the former, some under
21 the latter).
22
23
24
25                         OVERVIEW OF GNU MP
26
27 There are five classes of functions in GNU MP.
28
29  1. Signed integer arithmetic functions (mpz).  These functions are intended
30     to be easy to use, with their regular interface.  The associated type is
31     `mpz_t'.
32
33  2. Rational arithmetic functions (mpq).  For now, just a small set of
34     functions necessary for basic rational arithmetics.  The associated type
35     is `mpq_t'.
36
37  3. Floating-point arithmetic functions (mpf).  If the C type `double'
38     doesn't give enough precision for your application, declare your
39     variables as `mpf_t' instead, set the precision to any number desired,
40     and call the functions in the mpf class for the arithmetic operations.
41
42  4. Positive-integer, hard-to-use, very low overhead functions are in the
43     mpn class.  No memory management is performed.  The caller must ensure
44     enough space is available for the results.  The set of functions is not
45     regular, nor is the calling interface.  These functions accept input
46     arguments in the form of pairs consisting of a pointer to the least
47     significant word, and an integral size telling how many limbs (= words)
48     the pointer points to.
49
50     Almost all calculations, in the entire package, are made by calling these
51     low-level functions.
52
53  5. Berkeley MP compatible functions.
54
55     To use these functions, include the file "mp.h".  You can test if you are
56     using the GNU version by testing if the symbol __GNU_MP__ is defined.
57
58 For more information on how to use GNU MP, please refer to the documentation.
59 It is composed from the file gmp.texi, and can be displayed on the screen or
60 printed.  How to do that, as well how to build the library, is described in
61 the INSTALL file in this directory.
62
63
64
65                         REPORTING BUGS
66
67 If you find a bug in the library, please make sure to tell us about it!
68
69 You should first check the GNU MP web pages at http://www.swox.com/gmp/,
70 under "Status of the current release".  There will be patches for all known
71 serious bugs there.
72
73 Report bugs to bug-gmp@gnu.org.  What information is needed in a good bug
74 report is described in the manual.  The same address can be used for
75 suggesting modifications and enhancements.
76
77
78
79
80 ----------------
81 Local variables:
82 mode: text
83 fill-column: 78
84 End: