Module Intervals.V

A module for manipulating integer Values.

The type of arbitrary-precision integers with custom operations. ℂDuce integers use Big_int.big_int from the num library internaly, Most functions in this module are wrappers around those in Big_int.

include Custom.T
type t
val dump : Stdlib.Format.formatter -> t -> unit
val check : t -> unit
val equal : t -> t -> bool
val hash : t -> int
val compare : t -> t -> int
val print : Stdlib.Format.formatter -> t -> unit

print fmt i prints i to the given formatter.

val mk : string -> t

mk s creates an integer from its string decimal representation. The string can be prefixed with an optional + or -.

val from_int : int -> t

from_int i creates an integer from an OCaml int.

val from_bigint : Big_int.big_int -> t

from_bigint i creates an integer from Big_int.big_int, from the OCaml num library.

val to_string : t -> string
val is_int : t -> bool
val get_int : t -> int
val get_bigint : t -> Big_int.big_int
val is_zero : t -> bool
val add : t -> t -> t
val mult : t -> t -> t
val sub : t -> t -> t
val div : t -> t -> t
val modulo : t -> t -> t
val succ : t -> t
val pred : t -> t
val negat : t -> t
val lt : t -> t -> bool
val gt : t -> t -> bool
val zero : t
val one : t
val minus_one : t
val from_int32 : Stdlib.Int32.t -> t
val from_int64 : Stdlib.Int64.t -> t
val to_int32 : t -> Stdlib.Int32.t
val to_int64 : t -> Stdlib.Int64.t