diff --git a/src/core/CCInt32.ml b/src/core/CCInt32.ml index a08b23fc..45b3f4a5 100644 --- a/src/core/CCInt32.ml +++ b/src/core/CCInt32.ml @@ -2,9 +2,18 @@ include Int32 +[@@@iflt 4.13] + let min : t -> t -> t = Stdlib.min let max : t -> t -> t = Stdlib.max + +[@@@endif] +[@@@iflt 5.1] + let hash x = Stdlib.abs (to_int x) + +[@@@endif] + let sign i = compare i zero let pow a b = diff --git a/src/core/CCInt32.mli b/src/core/CCInt32.mli index 39431a33..bd1940cd 100644 --- a/src/core/CCInt32.mli +++ b/src/core/CCInt32.mli @@ -18,6 +18,8 @@ include module type of struct include Int32 end +[@@@iflt 4.13] + val min : t -> t -> t (** [min x y] returns the minimum of the two integers [x] and [y]. @since 3.0 *) @@ -26,10 +28,15 @@ val max : t -> t -> t (** [max x y] returns the maximum of the two integers [x] and [y]. @since 3.0 *) +[@@@endif] +[@@@iflt 5.1] + val hash : t -> int (** [hash x] computes the hash of [x]. Like {!Stdlib.abs (to_int x)}. *) +[@@@endif] + val sign : t -> int (** [sign x] return [0] if [x = 0], [-1] if [x < 0] and [1] if [x > 0]. Same as [compare x zero].