summaryrefslogtreecommitdiff
path: root/manual/manual/library/libnum.etex
blob: 6c66f46031c5b7d775adaa648dee064baf3ec847 (plain)
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
\chapter{The num library: arbitrary-precision rational arithmetic}
\pdfchapterfold{-3}{The num library: arbitrary-precision integer and rational arithmetic}
%HEVEA\cutname{libnum.html}

The "num" library implements integer arithmetic and rational
arithmetic in arbitrary precision.

More documentation on the functions provided in this library can be found
in {\em The CAML Numbers Reference Manual\/} by
Valérie Ménissier-Morain, technical report 141, INRIA, july 1992
(available electronically,
\url{http://hal.inria.fr/docs/00/07/00/27/PDF/RT-0141.pdf}).

Programs that use the "num" library must be linked as follows:
\begin{alltt}
        ocamlc \var{other options} nums.cma \var{other files}
        ocamlopt \var{other options} nums.cmxa \var{other files}
\end{alltt}
For interactive use of the "nums" library, do:
\begin{alltt}
        ocamlmktop -o mytop nums.cma
        ./mytop
\end{alltt}
or (if dynamic linking of C libraries is supported on your platform),
start "ocaml" and type "#load \"nums.cma\";;".

\ifouthtml
\begin{links}
\item \ahref{libref/Num.html}{Module \texttt{Num}: operation on arbitrary-precision numbers}
\item \ahref{libref/Big\_int.html}{Module \texttt{Big\_int}: operations on arbitrary-precision integers}
\item \ahref{libref/Arith\_status.html}{Module \texttt{Arith\_status}: flags that control rational arithmetic}
\end{links}
\else
\input{Num.tex}
\input{Bigint.tex}
\input{Arithstatus.tex}
\fi