Module type BatNumber.NUMERIC_BASE

module type NUMERIC_BASE = sig .. end
The smallest set of operations supported by every set of numbers

type t 
val zero : t
val one : t
val neg : t -> t
Arithmetic operations

Depending on the implementation, some of these operations may raise exceptions at run-time to represent over/under-flows.

val succ : t -> t
val pred : t -> t
val abs : t -> t
val add : t ->
t -> t
val sub : t ->
t -> t
val mul : t ->
t -> t
val div : t ->
t -> t
val modulo : t ->
t -> t
val pow : t ->
t -> t
val compare : t -> t -> int
val of_int : int -> t
Conversions

Convert this number to the closest integer.

val to_int : t -> int
Convert an integer to the closest element of set t.
val of_string : string -> t
Convert the representation of a number to the corresponding number.
Raises Invalid_argument if the string does not represent a valid number of type t
val to_string : t -> string
val of_float : float -> t
val to_float : t -> float