1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html40/loose.dtd">
<HTML>
<!-- Created on May, 7 2006 by texi2html 1.66 -->
<!--
Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
Karl Berry <karl@freefriends.org>
Olaf Bachmann <obachman@mathematik.uni-kl.de>
and many others.
Maintained by: Many creative people <dev@texi2html.cvshome.org>
Send bugs and suggestions to <users@texi2html.cvshome.org>
-->
<HEAD>
<TITLE>CLN, a Class Library for Numbers: Introduction</TITLE>
<META NAME="description" CONTENT="CLN, a Class Library for Numbers: Introduction">
<META NAME="keywords" CONTENT="CLN, a Class Library for Numbers: Introduction">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META NAME="Generator" CONTENT="texi2html 1.66">
</HEAD>
<BODY LANG="en" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000">
<A NAME="SEC1"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cln.html#SEC_Top"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cln_2.html#SEC2"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cln.html#SEC_Top"> << </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cln.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cln_2.html#SEC2"> >> </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cln.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cln_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cln_13.html#SEC75">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cln_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<A NAME="Introduction"></A>
<H1> 1. Introduction </H1>
<!--docid::SEC1::-->
<P>
CLN is a library for computations with all kinds of numbers.
It has a rich set of number classes:
</P>
<P>
<UL>
<LI>
Integers (with unlimited precision),
<P>
</P>
<LI>
Rational numbers,
<P>
</P>
<LI>
Floating-point numbers:
<P>
<UL>
<LI>
Short float,
<LI>
Single float,
<LI>
Double float,
<LI>
Long float (with unlimited precision),
</UL>
<P>
</P>
<LI>
Complex numbers,
<P>
</P>
<LI>
Modular integers (integers modulo a fixed integer),
<P>
</P>
<LI>
Univariate polynomials.
</UL>
<P>
The subtypes of the complex numbers among these are exactly the
types of numbers known to the Common Lisp language. Therefore
<CODE>CLN</CODE> can be used for Common Lisp implementations, giving
`<SAMP>CLN</SAMP>' another meaning: it becomes an abbreviation of
"Common Lisp Numbers".
</P>
<P>
The CLN package implements
</P>
<P>
<UL>
<LI>
Elementary functions (<CODE>+</CODE>, <CODE>-</CODE>, <CODE>*</CODE>, <CODE>/</CODE>, <CODE>sqrt</CODE>,
comparisons, <small>...</small>),
<P>
</P>
<LI>
Logical functions (logical <CODE>and</CODE>, <CODE>or</CODE>, <CODE>not</CODE>, <small>...</small>),
<P>
</P>
<LI>
Transcendental functions (exponential, logarithmic, trigonometric, hyperbolic
functions and their inverse functions).
</UL>
<P>
CLN is a C++ library. Using C++ as an implementation language provides
</P>
<P>
<UL>
<LI>
efficiency: it compiles to machine code,
<LI>
type safety: the C++ compiler knows about the number types and complains
if, for example, you try to assign a float to an integer variable.
<LI>
algebraic syntax: You can use the <CODE>+</CODE>, <CODE>-</CODE>, <CODE>*</CODE>, <CODE>=</CODE>,
<CODE>==</CODE>, <small>...</small> operators as in C or C++.
</UL>
<P>
CLN is memory efficient:
</P>
<P>
<UL>
<LI>
Small integers and short floats are immediate, not heap allocated.
<LI>
Heap-allocated memory is reclaimed through an automatic, non-interruptive
garbage collection.
</UL>
<P>
CLN is speed efficient:
</P>
<P>
<UL>
<LI>
The kernel of CLN has been written in assembly language for some CPUs
(<CODE>i386</CODE>, <CODE>m68k</CODE>, <CODE>sparc</CODE>, <CODE>mips</CODE>, <CODE>arm</CODE>).
<LI>
<A NAME="IDX1"></A>
On all CPUs, CLN may be configured to use the superefficient low-level
routines from GNU GMP version 3.
<LI>
It uses Karatsuba multiplication, which is significantly faster
for large numbers than the standard multiplication algorithm.
<LI>
For very large numbers (more than 12000 decimal digits), it uses
Schnhage-Strassen
<A NAME="IDX2"></A>
multiplication, which is an asymptotically optimal multiplication
algorithm, for multiplication, division and radix conversion.
</UL>
<P>
CLN aims at being easily integrated into larger software packages:
</P>
<P>
<UL>
<LI>
The garbage collection imposes no burden on the main application.
<LI>
The library provides hooks for memory allocation and exceptions.
<LI>
<A NAME="IDX3"></A>
All non-macro identifiers are hidden in namespace <CODE>cln</CODE> in
order to avoid name clashes.
</UL>
<P>
<A NAME="Installation"></A>
<HR SIZE="6">
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cln.html#SEC_Top"> << </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cln_2.html#SEC2"> >> </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cln.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cln_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cln_13.html#SEC75">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cln_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<BR>
<FONT SIZE="-1">
This document was generated
by <I>Richard B. Kreckel</I> on <I>May, 7 2006</I>
using <A HREF="http://texi2html.cvshome.org"><I>texi2html</I></A>
</FONT>
</BODY>
</HTML>
|