/modular-arithmetic

An ocaml library for operations on integer modulo some integer (the modulus)

Primary LanguageOCamlMozilla Public License 2.0MPL-2.0

modular-arithmetic

An ocaml library for operations on integers modulo some integer (the modulus)

Installation

Using opam:

$ opam install modular-arithmetic

Usage

Example:

module M = Mod_arith.Make(struct let modulus = 12 end)
let () =
  assert M.(equal (of_int 5 * of_int 2 + of_string "15") one)

License

This library and associated code are released under the Mozilla Public License 2.0 (check LICENSE.txt).

Copyright (c) 2018, Raphael Sousa Santos <contact@raphaelss.com>