ocaml/otherlibs/num
Xavier Leroy 5455e4e9d4 Eradication des warnings de gcc.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1602 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1997-06-13 15:54:18 +00:00
..
bignum Eradication des warnings de gcc. 1997-06-13 15:54:18 +00:00
test Correction de sqrt_nat 1996-11-13 20:18:37 +00:00
.cvsignore ignore plus finement les fichiers objet PPC sur Mac 1996-12-17 13:23:22 +00:00
.depend Bug de weak pointer sur entier + depend 1997-03-19 14:20:23 +00:00
.depend.nt Dependences pour NT. 1996-03-18 12:07:56 +00:00
Makefile Renommage make clean -> make partialclean et make realclean -> make clean. Non teste sur Mac et Win32. 1997-02-16 13:36:42 +00:00
Makefile.Mac deTABisation 1997-05-19 15:42:21 +00:00
Makefile.Mac.depend Portage Mac/MPW 1996-11-02 18:04:50 +00:00
Makefile.nt MAJ 1997-03-11 10:58:27 +00:00
README Portage de libnum pour Caml Special Light 1995-11-06 10:34:19 +00:00
arith_flags.ml Renommage en Objective Caml 1996-04-30 14:53:58 +00:00
arith_flags.mli Renommage en Objective Caml 1996-04-30 14:53:58 +00:00
arith_status.ml Renommage en Objective Caml 1996-04-30 14:53:58 +00:00
arith_status.mli Renommage en Objective Caml 1996-04-30 14:53:58 +00:00
big_int.ml deTABisation 1997-05-19 15:42:21 +00:00
big_int.mli Renommage en Objective Caml 1996-04-30 14:53:58 +00:00
int_misc.ml Utilisation de Sys.os_type et Sys.word_size. Nettoyages. 1996-11-07 10:59:54 +00:00
int_misc.mli Renommage en Objective Caml 1996-04-30 14:53:58 +00:00
nat.h Oubli 1995-11-06 13:09:04 +00:00
nat.ml Fix du bug signale par Harrison sur nat_of_string "0". 1997-06-12 15:27:11 +00:00
nat.mli Implementer length_nat par %obj_size au lieu de %array_length, qui 1996-09-23 11:31:32 +00:00
nat_stubs.c deTABisation 1997-05-19 15:42:21 +00:00
num.ml Renommage en Objective Caml 1996-04-30 14:53:58 +00:00
num.mli Renommage en Objective Caml 1996-04-30 14:53:58 +00:00
ratio.ml Renommage en Objective Caml 1996-04-30 14:53:58 +00:00
ratio.mli Renommage en Objective Caml 1996-04-30 14:53:58 +00:00
string_misc.ml Renommage en Objective Caml 1996-04-30 14:53:58 +00:00
string_misc.mli Renommage en Objective Caml 1996-04-30 14:53:58 +00:00

README

The "libnum" library implements exact-precision rational arithmetic.
It is built upon the state-of-the-art BigNum arbitrary-precision
integer arithmetic package, and therefore achieves very high
performance (it's faster than Maple, for instance).

This library is derived from Valerie Menissie-Morain's implementation
of rational arithmetic for Caml V3.1 (INRIA), and builds on the BigNum
package developed by Bernard Serpette, Jean Vuillemin and Jean-Claude
Herve (INRIA and Digital PRL). Xavier Leroy (INRIA) did the Caml Light
port. Victor Manuel Gulias Fernandez did the Caml Special Light port.

This library is documented in "The CAML Numbers Reference Manual" by 
Valerie Menissier-Morain, technical report 141, INRIA, july 1992,
available by anonymous FTP from ftp.inria.fr, directory
INRIA/publications/RT, file RT-0141.ps.Z.

USAGE:

To use the bignum library from your programs, just do

        cslc -custom <other options> nums.cma <other .cmo and .ml files> -lnums

for the linking phase.

If you'd like to have the bignum functions available at toplevel, do

        cslmktop -o csltopnum -custom <other options> nums.cma <other .cmo and .ml files> -lnums
        ./csltopnum

As an example, try:

        open Num;;
        let rec fact n =
          if n = 0 then Int 1 else mult_num (num_of_int n) (fact(n-1));;
        string_of_num(fact 1000);;

KNOWN TARGET ARCHITECTURES:

        C               portable C version (default)
        sparc           Sparc V8 assembly code, SunOS 4.1
        sparc-solaris   Sparc V8 assembly code, Solaris 2
        supersparc      Sparc V9 assembly code, SunOS 4.1
        supersparc-solaris Sparc V9 assembly code, Solaris 2
        mips            MIPS R2000, R3000, R4000 assembly code
        alpha           DEC Alpha (21064) assembly code
        68K             Motorola 68020 assembly code
        vax             DEC VAX assembly code
        i960            Intel 80960A assembly code
        ns              National Semiconductors 32032 assembly code
        pyramid         Pyramid minicomputers assembly code

LEGAL NOTICE:

This work uses the BigNum package developed jointly by INRIA and Digital PRL.

The code in the bignum/ subdirectory is copyright INRIA and Digital,
and may be reproduced and distributed freely to non commercial usage
according to the conditions stated in the documentation of this package
(directory bignum/doc).

KNOWN PROBLEMS:

64-bit architectures are not yet fully supported.  The test suite passes on 
a Dec Alpha, but some bugs remain.