mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 03:05:28 -05:00
CCInt.hash
This commit is contained in:
parent
b72f8683ce
commit
488e97b439
2 changed files with 4 additions and 0 deletions
|
|
@ -30,6 +30,8 @@ let equal a b = a=b
|
||||||
|
|
||||||
let compare a b = Pervasives.compare a b
|
let compare a b = Pervasives.compare a b
|
||||||
|
|
||||||
|
let hash i = i land max_int
|
||||||
|
|
||||||
let sign i =
|
let sign i =
|
||||||
if i < 0 then -1
|
if i < 0 then -1
|
||||||
else if i>0 then 1
|
else if i>0 then 1
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,8 @@ val compare : t -> t -> int
|
||||||
|
|
||||||
val equal : t -> t -> bool
|
val equal : t -> t -> bool
|
||||||
|
|
||||||
|
val hash : t -> int
|
||||||
|
|
||||||
val sign : t -> int
|
val sign : t -> int
|
||||||
(** [sign i] is one of [-1, 0, 1] *)
|
(** [sign i] is one of [-1, 0, 1] *)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue