diff --git a/core/CCInt.ml b/core/CCInt.ml index 29a898e3..4a7bbf1f 100644 --- a/core/CCInt.ml +++ b/core/CCInt.ml @@ -37,6 +37,8 @@ let sign i = else if i>0 then 1 else 0 +let neg i = -i + type 'a printer = Buffer.t -> 'a -> unit type 'a formatter = Format.formatter -> 'a -> unit type 'a random_gen = Random.State.t -> 'a diff --git a/core/CCInt.mli b/core/CCInt.mli index e62291a1..3fcd33ac 100644 --- a/core/CCInt.mli +++ b/core/CCInt.mli @@ -37,6 +37,10 @@ val hash : t -> int val sign : t -> int (** [sign i] is one of [-1, 0, 1] *) +val neg : t -> t +(** [neg i = - i] + @since NEXT_RELEASE *) + type 'a printer = Buffer.t -> 'a -> unit type 'a formatter = Format.formatter -> 'a -> unit type 'a random_gen = Random.State.t -> 'a