# Chapter 26 The num library: arbitrary-precision rational arithmetic

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 The CAML Numbers Reference Manual by Valérie Ménissier-Morain, technical report 141, INRIA, july 1992 (available electronically, http://hal.inria.fr/docs/00/07/00/27/PDF/RT-0141.pdf).

Programs that use the num library must be linked as follows:

            ocamlc other options nums.cma other files
            ocamlopt other options nums.cmxa other files

For interactive use of the nums library, do:

            ocamlmktop -o mytop nums.cma
            ./mytop

or (if dynamic linking of C libraries is supported on your platform), start ocaml and type #load "nums.cma";;.

- Module Num: operation on arbitrary-precision numbers
- Module Big_int: operations on arbitrary-precision integers
- Module Arith_status: flags that control rational arithmetic