package osdp

  1. Overview
  2. Docs

Module Scalar.MakeSource

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

module M : M

Signature

include M with type t = M.t
type t = M.t
val compare : t -> t -> int

A few values.

val zero : t
val one : t

Conversion functions.

val of_float : float -> t
val to_float : t -> float
val of_q : Q.t -> t
val to_q : t -> Q.t

Arithmetic operations.

val add : t -> t -> t
val sub : t -> t -> t
val mult : t -> t -> t
val div : t -> t -> t

Printing.

val pp : Format.formatter -> t -> unit
Sourceval minus_one : t

More conversion functions.

Sourceval of_int : int -> t

More arithmetic operations.

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

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

Prefix and infix operators.

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

Innovation. Community. Security.