Euler

Euler is a library for doing arithmetic with OCaml’s native integers (31 or 63 bits).

Documentation. Algorithmic complexities are documented. Besides, implementation code has a lot of comments.

What’s in it?

Euler provides:

Why to use it?

Euler may prove actually useful outside of the playground.

However the functions related to prime numbers, for instance, are more of an educational or recreational interest, because of their limitation to native integers. Actual applications, such as cryptography, need arbitrary-precision integers.

Why has it been written?

Writing this library was fun and educative for me, and allowed me to solidify my math training in code. In fact, as the name suggests, the initial incentive was to play with Project Euler (hence the focus on integers that fit in a machine word) while sparing me the boredom of re-implementing a prime sieve for the hundredth time.