]> www.ginac.de Git - cln.git/blob - doc/cln_1.html
* All Files have been modified for inclusion of namespace cln;
[cln.git] / doc / cln_1.html
1 <HTML>
2 <HEAD>
3 <!-- Created by texi2html 1.56k from cln.texi on 28 August 2000 -->
4
5 <TITLE>CLN, a Class Library for Numbers - 1. Introduction</TITLE>
6 </HEAD>
7 <BODY>
8 Go to the first, previous, <A HREF="cln_2.html">next</A>, <A HREF="cln_13.html">last</A> section, <A HREF="cln_toc.html">table of contents</A>.
9 <P><HR><P>
10
11
12 <H1><A NAME="SEC1" HREF="cln_toc.html#TOC1">1. Introduction</A></H1>
13
14 <P>
15 CLN is a library for computations with all kinds of numbers.
16 It has a rich set of number classes:
17
18
19
20 <UL>
21 <LI>
22
23 Integers (with unlimited precision),
24
25 <LI>
26
27 Rational numbers,
28
29 <LI>
30
31 Floating-point numbers:
32
33
34 <UL>
35 <LI>
36
37 Short float,
38 <LI>
39
40 Single float,
41 <LI>
42
43 Double float,
44 <LI>
45
46 Long float (with unlimited precision),
47 </UL>
48
49 <LI>
50
51 Complex numbers,
52
53 <LI>
54
55 Modular integers (integers modulo a fixed integer),
56
57 <LI>
58
59 Univariate polynomials.
60 </UL>
61
62 <P>
63 The subtypes of the complex numbers among these are exactly the
64 types of numbers known to the Common Lisp language. Therefore
65 <CODE>CLN</CODE> can be used for Common Lisp implementations, giving
66 <SAMP>`CLN'</SAMP> another meaning: it becomes an abbreviation of
67 "Common Lisp Numbers".
68
69
70 <P>
71 The CLN package implements
72
73
74
75 <UL>
76 <LI>
77
78 Elementary functions (<CODE>+</CODE>, <CODE>-</CODE>, <CODE>*</CODE>, <CODE>/</CODE>, <CODE>sqrt</CODE>,
79 comparisons, ...),
80
81 <LI>
82
83 Logical functions (logical <CODE>and</CODE>, <CODE>or</CODE>, <CODE>not</CODE>, ...),
84
85 <LI>
86
87 Transcendental functions (exponential, logarithmic, trigonometric, hyperbolic
88 functions and their inverse functions).
89 </UL>
90
91 <P>
92 CLN is a C++ library. Using C++ as an implementation language provides
93
94
95
96 <UL>
97 <LI>
98
99 efficiency: it compiles to machine code,
100 <LI>
101
102 type safety: the C++ compiler knows about the number types and complains
103 if, for example, you try to assign a float to an integer variable.
104 <LI>
105
106 algebraic syntax: You can use the <CODE>+</CODE>, <CODE>-</CODE>, <CODE>*</CODE>, <CODE>=</CODE>,
107 <CODE>==</CODE>, ... operators as in C or C++.
108 </UL>
109
110 <P>
111 CLN is memory efficient:
112
113
114
115 <UL>
116 <LI>
117
118 Small integers and short floats are immediate, not heap allocated.
119 <LI>
120
121 Heap-allocated memory is reclaimed through an automatic, non-interruptive
122 garbage collection.
123 </UL>
124
125 <P>
126 CLN is speed efficient:
127
128
129
130 <UL>
131 <LI>
132
133 The kernel of CLN has been written in assembly language for some CPUs
134 (<CODE>i386</CODE>, <CODE>m68k</CODE>, <CODE>sparc</CODE>, <CODE>mips</CODE>, <CODE>arm</CODE>).
135 <LI>
136
137 <A NAME="IDX1"></A>
138 On all CPUs, CLN may be configured to use the superefficient low-level
139 routines from GNU GMP version 3.
140 <LI>
141
142 It uses Karatsuba multiplication, which is significantly faster
143 for large numbers than the standard multiplication algorithm.
144 <LI>
145
146 For very large numbers (more than 12000 decimal digits), it uses
147 Schönhage-Strassen
148 <A NAME="IDX2"></A>
149 multiplication, which is an asymptotically optimal multiplication
150 algorithm, for multiplication, division and radix conversion.
151 </UL>
152
153 <P>
154 CLN aims at being easily integrated into larger software packages:
155
156
157
158 <UL>
159 <LI>
160
161 The garbage collection imposes no burden on the main application.
162 <LI>
163
164 The library provides hooks for memory allocation and exceptions.
165 <LI>
166
167 <A NAME="IDX3"></A>
168 All non-macro identifiers are hidden in namespace <CODE>cln</CODE> in 
169 order to avoid name clashes.
170 </UL>
171
172 <P><HR><P>
173 Go to the first, previous, <A HREF="cln_2.html">next</A>, <A HREF="cln_13.html">last</A> section, <A HREF="cln_toc.html">table of contents</A>.
174 </BODY>
175 </HTML>