Richard Kreckel
25 years ago
17 changed files with 0 additions and 15865 deletions
-
BINdoc/cln.dvi
-
4898doc/cln.html
-
5902doc/cln.ps
-
175doc/cln_1.html
-
163doc/cln_10.html
-
476doc/cln_11.html
-
108doc/cln_12.html
-
22doc/cln_13.html
-
279doc/cln_2.html
-
401doc/cln_3.html
-
2018doc/cln_4.html
-
424doc/cln_5.html
-
125doc/cln_6.html
-
251doc/cln_7.html
-
139doc/cln_8.html
-
359doc/cln_9.html
-
125doc/cln_toc.html
4898
doc/cln.html
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
5902
doc/cln.ps
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -1,175 +0,0 @@ |
|||
<HTML> |
|||
<HEAD> |
|||
<!-- Created by texi2html 1.56k from cln.texi on 28 August 2000 --> |
|||
|
|||
<TITLE>CLN, a Class Library for Numbers - 1. Introduction</TITLE> |
|||
</HEAD> |
|||
<BODY> |
|||
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>. |
|||
<P><HR><P> |
|||
|
|||
|
|||
<H1><A NAME="SEC1" HREF="cln_toc.html#TOC1">1. Introduction</A></H1> |
|||
|
|||
<P> |
|||
CLN is a library for computations with all kinds of numbers. |
|||
It has a rich set of number classes: |
|||
|
|||
|
|||
|
|||
<UL> |
|||
<LI> |
|||
|
|||
Integers (with unlimited precision), |
|||
|
|||
<LI> |
|||
|
|||
Rational numbers, |
|||
|
|||
<LI> |
|||
|
|||
Floating-point numbers: |
|||
|
|||
|
|||
<UL> |
|||
<LI> |
|||
|
|||
Short float, |
|||
<LI> |
|||
|
|||
Single float, |
|||
<LI> |
|||
|
|||
Double float, |
|||
<LI> |
|||
|
|||
Long float (with unlimited precision), |
|||
</UL> |
|||
|
|||
<LI> |
|||
|
|||
Complex numbers, |
|||
|
|||
<LI> |
|||
|
|||
Modular integers (integers modulo a fixed integer), |
|||
|
|||
<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> |
|||
The CLN package implements |
|||
|
|||
|
|||
|
|||
<UL> |
|||
<LI> |
|||
|
|||
Elementary functions (<CODE>+</CODE>, <CODE>-</CODE>, <CODE>*</CODE>, <CODE>/</CODE>, <CODE>sqrt</CODE>, |
|||
comparisons, ...), |
|||
|
|||
<LI> |
|||
|
|||
Logical functions (logical <CODE>and</CODE>, <CODE>or</CODE>, <CODE>not</CODE>, ...), |
|||
|
|||
<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 |
|||
|
|||
|
|||
|
|||
<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>, ... operators as in C or C++. |
|||
</UL> |
|||
|
|||
<P> |
|||
CLN is memory efficient: |
|||
|
|||
|
|||
|
|||
<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: |
|||
|
|||
|
|||
|
|||
<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 |
|||
Schönhage-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: |
|||
|
|||
|
|||
|
|||
<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><HR><P> |
|||
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>. |
|||
</BODY> |
|||
</HTML> |
HTTP/1.1 200 OK
Content-Type: text/html; charset=UTF-8
Set-Cookie: i_like_gitea=6d14f82c7892354e; Path=/; HttpOnly; SameSite=Lax
Set-Cookie: _csrf=Plsfpsv3tZZBmP_bSzE4NSlVRl46MTczNTAwNzE4MDUzNzg2MjIyNA; Path=/; Expires=Wed, 25 Dec 2024 02:26:20 GMT; HttpOnly; SameSite=Lax
Set-Cookie: macaron_flash=; Path=/; Max-Age=0; HttpOnly; SameSite=Lax
X-Frame-Options: SAMEORIGIN
Date: Tue, 24 Dec 2024 02:26:20 GMT
Transfer-Encoding: chunked
a928
sp/cln_mirror - include/cln/dfloat_io.h at 54da7c48fcf7c69731f40fcb52ceb02bf6782206 - cln_mirror - Gitea: Git with a cup of tea
0
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
872 B
31 lines
872 B
// I/O of dfloats.
|
|
|
|
#ifndef _CL_DFLOAT_IO_H
|
|
#define _CL_DFLOAT_IO_H
|
|
|
|
#include "cln/number_io.h"
|
|
#include "cln/dfloat.h"
|
|
|
|
namespace cln {
|
|
|
|
inline std::istream& operator>> (std::istream& stream, cl_DF& result)
|
|
{
|
|
extern cl_read_flags cl_DF_read_flags;
|
|
extern const cl_F read_float (std::istream&, const cl_read_flags&);
|
|
result = As(cl_DF)(read_float(stream,cl_DF_read_flags));
|
|
return stream;
|
|
}
|
|
|
|
// The following does strictly the same as the general `fprint' for floats.
|
|
// It is here only so that people don't need to include <cln/float_io.h>.
|
|
inline void fprint (std::ostream& stream, const cl_DF& x)
|
|
{
|
|
extern void print_float (std::ostream& stream, const cl_print_flags& flags, const cl_F& z);
|
|
extern cl_print_flags default_print_flags;
|
|
print_float(stream,default_print_flags,x);
|
|
}
|
|
CL_DEFINE_PRINT_OPERATOR(cl_DF)
|
|
|
|
} // namespace cln
|
|
|
|
#endif /* _CL_DFLOAT_IO_H */
|