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.

170 lines
3.2 KiB

25 years ago
25 years ago
25 years ago
25 years ago
  1. <HTML>
  2. <HEAD>
  3. <!-- Created by texi2html 1.56k from cln.texi on 2 June 2000 -->
  4. <TITLE>CLN, a Class Library for Numbers - 1. Introduction</TITLE>
  5. </HEAD>
  6. <BODY>
  7. 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>.
  8. <P><HR><P>
  9. <H1><A NAME="SEC1" HREF="cln_toc.html#TOC1">1. Introduction</A></H1>
  10. <P>
  11. CLN is a library for computations with all kinds of numbers.
  12. It has a rich set of number classes:
  13. <UL>
  14. <LI>
  15. Integers (with unlimited precision),
  16. <LI>
  17. Rational numbers,
  18. <LI>
  19. Floating-point numbers:
  20. <UL>
  21. <LI>
  22. Short float,
  23. <LI>
  24. Single float,
  25. <LI>
  26. Double float,
  27. <LI>
  28. Long float (with unlimited precision),
  29. </UL>
  30. <LI>
  31. Complex numbers,
  32. <LI>
  33. Modular integers (integers modulo a fixed integer),
  34. <LI>
  35. Univariate polynomials.
  36. </UL>
  37. <P>
  38. The subtypes of the complex numbers among these are exactly the
  39. types of numbers known to the Common Lisp language. Therefore
  40. <CODE>CLN</CODE> can be used for Common Lisp implementations, giving
  41. <SAMP>`CLN'</SAMP> another meaning: it becomes an abbreviation of
  42. "Common Lisp Numbers".
  43. <P>
  44. The CLN package implements
  45. <UL>
  46. <LI>
  47. Elementary functions (<CODE>+</CODE>, <CODE>-</CODE>, <CODE>*</CODE>, <CODE>/</CODE>, <CODE>sqrt</CODE>,
  48. comparisons, ...),
  49. <LI>
  50. Logical functions (logical <CODE>and</CODE>, <CODE>or</CODE>, <CODE>not</CODE>, ...),
  51. <LI>
  52. Transcendental functions (exponential, logarithmic, trigonometric, hyperbolic
  53. functions and their inverse functions).
  54. </UL>
  55. <P>
  56. CLN is a C++ library. Using C++ as an implementation language provides
  57. <UL>
  58. <LI>
  59. efficiency: it compiles to machine code,
  60. <LI>
  61. type safety: the C++ compiler knows about the number types and complains
  62. if, for example, you try to assign a float to an integer variable.
  63. <LI>
  64. algebraic syntax: You can use the <CODE>+</CODE>, <CODE>-</CODE>, <CODE>*</CODE>, <CODE>=</CODE>,
  65. <CODE>==</CODE>, ... operators as in C or C++.
  66. </UL>
  67. <P>
  68. CLN is memory efficient:
  69. <UL>
  70. <LI>
  71. Small integers and short floats are immediate, not heap allocated.
  72. <LI>
  73. Heap-allocated memory is reclaimed through an automatic, non-interruptive
  74. garbage collection.
  75. </UL>
  76. <P>
  77. CLN is speed efficient:
  78. <UL>
  79. <LI>
  80. The kernel of CLN has been written in assembly language for some CPUs
  81. (<CODE>i386</CODE>, <CODE>m68k</CODE>, <CODE>sparc</CODE>, <CODE>mips</CODE>, <CODE>arm</CODE>).
  82. <LI>
  83. <A NAME="IDX1"></A>
  84. On all CPUs, CLN may be configured to use the superefficient low-level
  85. routines from GNU GMP version 3.
  86. <LI>
  87. It uses Karatsuba multiplication, which is significantly faster
  88. for large numbers than the standard multiplication algorithm.
  89. <LI>
  90. For very large numbers (more than 12000 decimal digits), it uses
  91. Sch�nhage-Strassen
  92. <A NAME="IDX2"></A>
  93. multiplication, which is an asymptotically optimal multiplication
  94. algorithm, for multiplication, division and radix conversion.
  95. </UL>
  96. <P>
  97. CLN aims at being easily integrated into larger software packages:
  98. <UL>
  99. <LI>
  100. The garbage collection imposes no burden on the main application.
  101. <LI>
  102. The library provides hooks for memory allocation and exceptions.
  103. </UL>
  104. <P><HR><P>
  105. 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>.
  106. </BODY>
  107. </HTML>