3 <!-- Created by texi2html 1.56k from cln.texi on 28 August 2000 -->
5 <TITLE>CLN, a Class Library for Numbers - 1. Introduction</TITLE>
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>.
12 <H1><A NAME="SEC1" HREF="cln_toc.html#TOC1">1. Introduction</A></H1>
15 CLN is a library for computations with all kinds of numbers.
16 It has a rich set of number classes:
23 Integers (with unlimited precision),
31 Floating-point numbers:
46 Long float (with unlimited precision),
55 Modular integers (integers modulo a fixed integer),
59 Univariate polynomials.
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".
71 The CLN package implements
78 Elementary functions (<CODE>+</CODE>, <CODE>-</CODE>, <CODE>*</CODE>, <CODE>/</CODE>, <CODE>sqrt</CODE>,
83 Logical functions (logical <CODE>and</CODE>, <CODE>or</CODE>, <CODE>not</CODE>, ...),
87 Transcendental functions (exponential, logarithmic, trigonometric, hyperbolic
88 functions and their inverse functions).
92 CLN is a C++ library. Using C++ as an implementation language provides
99 efficiency: it compiles to machine code,
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.
106 algebraic syntax: You can use the <CODE>+</CODE>, <CODE>-</CODE>, <CODE>*</CODE>, <CODE>=</CODE>,
107 <CODE>==</CODE>, ... operators as in C or C++.
111 CLN is memory efficient:
118 Small integers and short floats are immediate, not heap allocated.
121 Heap-allocated memory is reclaimed through an automatic, non-interruptive
126 CLN is speed efficient:
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>).
138 On all CPUs, CLN may be configured to use the superefficient low-level
139 routines from GNU GMP version 3.
142 It uses Karatsuba multiplication, which is significantly faster
143 for large numbers than the standard multiplication algorithm.
146 For very large numbers (more than 12000 decimal digits), it uses
149 multiplication, which is an asymptotically optimal multiplication
150 algorithm, for multiplication, division and radix conversion.
154 CLN aims at being easily integrated into larger software packages:
161 The garbage collection imposes no burden on the main application.
164 The library provides hooks for memory allocation and exceptions.
168 All non-macro identifiers are hidden in namespace <CODE>cln</CODE> in
169 order to avoid name clashes.
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>.