mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 11:15:31 -05:00
add monomorphic signatures in CCInt and CCFloat
This commit is contained in:
parent
d3b6f6020f
commit
b17f55b1d1
4 changed files with 78 additions and 0 deletions
|
|
@ -74,3 +74,13 @@ let random_range i j st = i +. random (j-.i) st
|
|||
let equal_precision ~epsilon a b = abs_float (a-.b) < epsilon
|
||||
|
||||
let classify = Pervasives.classify_float
|
||||
|
||||
module Infix = struct
|
||||
let (=) = Pervasives.(=)
|
||||
let (<>) = Pervasives.(<>)
|
||||
let (<) = Pervasives.(<)
|
||||
let (>) = Pervasives.(>)
|
||||
let (<=) = Pervasives.(<=)
|
||||
let (>=) = Pervasives.(>=)
|
||||
end
|
||||
include Infix
|
||||
|
|
|
|||
|
|
@ -76,3 +76,28 @@ val equal_precision : epsilon:t -> t -> t -> bool
|
|||
(** Equality with allowed error up to a non negative epsilon value *)
|
||||
|
||||
val classify : float -> fpclass
|
||||
|
||||
(** {2 Infix Operators}
|
||||
|
||||
@since NEXT_RELEASE *)
|
||||
module Infix : sig
|
||||
val (=) : t -> t -> bool
|
||||
(** @since NEXT_RELEASE *)
|
||||
|
||||
val (<>) : t -> t -> bool
|
||||
(** @since NEXT_RELEASE *)
|
||||
|
||||
val (<) : t -> t -> bool
|
||||
(** @since NEXT_RELEASE *)
|
||||
|
||||
val (>) : t -> t -> bool
|
||||
(** @since NEXT_RELEASE *)
|
||||
|
||||
val (<=) : t -> t -> bool
|
||||
(** @since NEXT_RELEASE *)
|
||||
|
||||
val (>=) : t -> t -> bool
|
||||
(** @since NEXT_RELEASE *)
|
||||
end
|
||||
|
||||
include module type of Infix
|
||||
|
|
|
|||
|
|
@ -53,3 +53,15 @@ let to_string = string_of_int
|
|||
let of_string s =
|
||||
try Some (int_of_string s)
|
||||
with _ -> None
|
||||
|
||||
module Infix = struct
|
||||
let (=) = Pervasives.(=)
|
||||
let (<>) = Pervasives.(<>)
|
||||
let (<) = Pervasives.(<)
|
||||
let (>) = Pervasives.(>)
|
||||
let (<=) = Pervasives.(<=)
|
||||
let (>=) = Pervasives.(>=)
|
||||
end
|
||||
include Infix
|
||||
let min = min
|
||||
let max = max
|
||||
|
|
|
|||
|
|
@ -39,3 +39,34 @@ val to_string : t -> string
|
|||
|
||||
val of_string : string -> t option
|
||||
(** @since 0.13 *)
|
||||
|
||||
val min : t -> t -> t
|
||||
(** @since NEXT_RELEASE *)
|
||||
|
||||
val max : t -> t -> t
|
||||
(** @since NEXT_RELEASE *)
|
||||
|
||||
(** {2 Infix Operators}
|
||||
|
||||
@since NEXT_RELEASE *)
|
||||
module Infix : sig
|
||||
val (=) : t -> t -> bool
|
||||
(** @since NEXT_RELEASE *)
|
||||
|
||||
val (<>) : t -> t -> bool
|
||||
(** @since NEXT_RELEASE *)
|
||||
|
||||
val (<) : t -> t -> bool
|
||||
(** @since NEXT_RELEASE *)
|
||||
|
||||
val (>) : t -> t -> bool
|
||||
(** @since NEXT_RELEASE *)
|
||||
|
||||
val (<=) : t -> t -> bool
|
||||
(** @since NEXT_RELEASE *)
|
||||
|
||||
val (>=) : t -> t -> bool
|
||||
(** @since NEXT_RELEASE *)
|
||||
end
|
||||
|
||||
include module type of Infix
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue