Page
Library
Module
Module type
Parameter
Class
Class type
Source
Modular.MakeSourceThe functor application Make (M) defines modular arithmetic operations with a fixed, non‐zero modulus M.modulo. Because the modulus needs not be repeated for each individual operation, meaningful unary and binary operators can be defined. Operations in the resulting module follow the same specifications as those in module Modular, with respect to return values, exceptions raised, and time costs.
module _ : sig ... endThe (positive) modulus m.
The type of an element of the ring ℤ∕mℤ.
This is Modular.div_nonunique ~modulo.
This is Modular.inv_factorize ~modulo.
The following operators are shortcuts that spare us the need to write of_int conversions on their operands. The most useful ones are ( *.:) and (/:.), for multiplicative literal constants.