GithubHelp home page GithubHelp logo

rgrinberg / num Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ocaml/num

0.0 2.0 0.0 415 KB

The legacy Num library for arbitrary-precision integer and rational arithmetic that used to be part of the OCaml core distribution

License: Other

Makefile 1.78% OCaml 60.80% C 23.27% Standard ML 14.15%

num's Introduction

The Num library for arithmetic on big integers and rationals

Overview

This library implements arbitrary-precision arithmetic on big integers and on rationals.

This is a legacy library. It used to be part of the core OCaml distribution (in otherlibs/num) but is now distributed separately. New applications that need arbitrary-precision arithmetic should use the Zarith library (https://github.com/ocaml/Zarith) instead of the Num library, and older applications that already use Num are encouraged to switch to Zarith. Zarith delivers much better performance than Num and has a nicer API.

Usage

To use the bignum library from your programs, it is recommended to use ocamlfind:

    ocamlfind ocamlc -package num ...
    ocamlfind ocamlopt -package num ...

Alternatively, you can do

    ocamlc <options> nums.cma <.cmo and .ml files>
    ocamlopt <options> nums.cmxa <.cmx and .ml files>

For toplevel use, just issue the commands

    #use "topfind";;
    #package "num";;

or

    #load "nums.cma";;

Documentation

The following modules are documented in their interfaces:

  • Big_int: operations on arbitrary-precision integers
  • Num: operations on arbitrary-precision numbers (integers and rationals)
  • Arith_status: flags that control rational arithmetic

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

Compilation and installation

Prerequisites: OCaml version 4.04 or newer.

        make all
        make test
        make install
        make clean

History

This library is derived from Valérie Ménissier-Morain's implementation of rational arithmetic for Caml V3.1. Xavier Leroy did the Caml Light port. Victor Manuel Gulias Fernandez did the initial Caml Special Light / OCaml port. Pierre Weis did most of the maintenance and bug fixing.

Initially, the low-level big integer operations were provided by the BigNum package developed by Bernard Serpette, Jean Vuillemin and Jean-Claude Hervé (INRIA and Digital PRL). License issues forced us to replace the BigNum package. The current implementation of low-level big integer operations is due to Xavier Leroy.

num's People

Contributors

xavierleroy avatar pierreweis avatar dra27 avatar gasche avatar alainfrisch avatar lefessan avatar damiendoligez avatar zoggy avatar hhugo avatar shindere avatar np avatar thelortex avatar maranget avatar bschommer avatar roglo avatar kit-ty-kate avatar mshinwell avatar nojb avatar glondu avatar xclerc avatar whitequark avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.