Functor Scalar.Make

module Make: 
functor (M : M) -> S with type t = M.t

Adds extended operations.

minus_one is defined as M.sub M.zero M.one.

of_int n is defined as M.of_float (float_of_int n). Beware that this may overflow for large 63 bits integers.

neg x is defined as M.sub M.zero x.

inv x is defined as M.div M.one x.

Additional comparison operations are defined based on M.compare.

Parameters:
M : M

include Scalar.M
val minus_one : t

More conversion functions.

val of_int : int -> t

More arithmetic operations.

val neg : t -> t
val inv : t -> t
val equal : t -> t -> bool
val leq : t -> t -> bool
val geq : t -> t -> bool
val lt : t -> t -> bool
val gt : t -> t -> bool
val sign : t -> int

Returns -1, 0 or 1 when its argument is respectively < 0, 0 or > 0.

Prefix and infix operators.

val (~-) : t -> t
val (+) : t -> t -> t
val (-) : t -> t -> t
val ( * ) : t -> t -> t
val (/) : t -> t -> t
val (=) : t -> t -> bool
val (<>) : t -> t -> bool
val (<=) : t -> t -> bool
val (>=) : t -> t -> bool
val (<) : t -> t -> bool
val (>) : t -> t -> bool