CCInt.hash

This commit is contained in:
Simon Cruanes 2014-05-22 23:58:58 +02:00
parent b72f8683ce
commit 488e97b439
2 changed files with 4 additions and 0 deletions

View file

@ -30,6 +30,8 @@ let equal a b = a=b
let compare a b = Pervasives.compare a b
let hash i = i land max_int
let sign i =
if i < 0 then -1
else if i>0 then 1

View file

@ -32,6 +32,8 @@ val compare : t -> t -> int
val equal : t -> t -> bool
val hash : t -> int
val sign : t -> int
(** [sign i] is one of [-1, 0, 1] *)