I’ve done some searching around and apparently there used to be a Bignum module in the standard library according to this But at this point I don’t see anything in the standard library.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There is no bignum module in the core OCaml distribution. The official recommendation is to use the third-party
Zarithlibrary, specifically itsZmodule.If you’ve installed OCaml as part of your operating system distribution, see if it has a package for Zarith. For example, on Debian, Ubuntu and derivatives, it’s
libzarith-ocaml-dev. If Zarith isn’t available through your operating system, install it with OPAM:When building your application, compile with one of
To use Zarith in the toplevel:
Older versions of Ocaml had a bignum module in the standard distribution (but not in the standard library: it didn’t require separate installation, but had to be linked explicitly). It was the
numslibrary, and its main moduleNum. Since OCaml 4.06, thenumslibrary is distributed separately.Technically, there is no bignum module in the standard library, because the standard library in Ocaml terminology is the default library that programs are compiled against, and there’s no bignum module in that. Nor is there a
Bignumlibrary — because the bignum library is callednums, and its main module is calledNum. It has been part of the standard Ocaml distribution since before Ocaml was called Ocaml, and still is.