ocaml/otherlibs/num
Damien Doligez 43b02185d7 ajout option -stypes; depend
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5478 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2003-04-02 01:32:09 +00:00
..
bignum Portage Mingw et revision du portage Win32/MSVC 2002-06-07 09:49:45 +00:00
test Suite portage Mingw 2002-06-07 13:31:21 +00:00
.cvsignore ajout so_locations dans .cvsignore 2001-10-11 12:04:40 +00:00
.depend ajout option -stypes; depend 2003-04-02 01:32:09 +00:00
.depend.nt Chargement dynamique de primitives C 2001-08-28 14:47:48 +00:00
Makefile Installer les stub DLLs dans LIBDIR/stublibs 2002-06-27 11:36:02 +00:00
Makefile.Mac detabisation 2002-07-23 14:12:03 +00:00
Makefile.Mac.depend deps 2001-08-21 18:50:41 +00:00
Makefile.nt Installer les stub DLLs dans LIBDIR/stublibs 2002-06-27 11:36:02 +00:00
README fix -lnums -> -cclib -lnums 1997-10-14 13:29:43 +00:00
arith_flags.ml MAJ en-tetes pour mentionner la 'special exception' sur la LGPL 2001-12-07 13:41:02 +00:00
arith_flags.mli MAJ en-tetes pour mentionner la 'special exception' sur la LGPL 2001-12-07 13:41:02 +00:00
arith_status.ml MAJ en-tetes pour mentionner la 'special exception' sur la LGPL 2001-12-07 13:41:02 +00:00
arith_status.mli MAJ en-tetes pour mentionner la 'special exception' sur la LGPL 2001-12-07 13:41:02 +00:00
big_int.ml Retour en arriere sur le precedent commit 2002-05-27 12:06:49 +00:00
big_int.mli Retour en arriere sur l'exponentiation modulaire, pas correcte 2002-03-14 20:12:54 +00:00
int_misc.ml Retour en arriere sur le precedent commit 2002-05-27 12:06:49 +00:00
int_misc.mli MAJ en-tetes pour mentionner la 'special exception' sur la LGPL 2001-12-07 13:41:02 +00:00
nat.h MAJ en-tetes pour mentionner la 'special exception' sur la LGPL 2001-12-07 13:41:02 +00:00
nat.ml Retour en arriere sur l'exponentiation modulaire, pas correcte 2002-03-14 20:12:54 +00:00
nat.mli Retour en arriere sur l'exponentiation modulaire, pas correcte 2002-03-14 20:12:54 +00:00
nat_stubs.c MAJ en-tetes pour mentionner la 'special exception' sur la LGPL 2001-12-07 13:41:02 +00:00
num.ml MAJ en-tetes pour mentionner la 'special exception' sur la LGPL 2001-12-07 13:41:02 +00:00
num.mli changement niveaux de titre dans les commentaires 2001-12-28 23:15:23 +00:00
ratio.ml MAJ en-tetes pour mentionner la 'special exception' sur la LGPL 2001-12-07 13:41:02 +00:00
ratio.mli MAJ en-tetes pour mentionner la 'special exception' sur la LGPL 2001-12-07 13:41:02 +00:00
string_misc.ml MAJ en-tetes pour mentionner la 'special exception' sur la LGPL 2001-12-07 13:41:02 +00:00
string_misc.mli MAJ en-tetes pour mentionner la 'special exception' sur la LGPL 2001-12-07 13:41:02 +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

    ocamlc -custom <options> nums.cma <.cmo and .ml files> -cclib -lnums

for the linking phase.

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

    ocamlmktop -o ocamltopnum -custom <options> nums.cma <.cmo and .ml files> -cclib -lnums
    ./ocamltopnum

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.