diff --git a/src/core/CCInt.ml b/src/core/CCInt.ml index f260c719..c7b81a94 100644 --- a/src/core/CCInt.ml +++ b/src/core/CCInt.ml @@ -42,13 +42,6 @@ let range' i j yield = [5;4;3] (range' 5 2 |> Sequence.to_list) *) -module Infix = struct - include Pervasives - let (--) = range - let (--^) = range' -end -include Infix - let sign i = if i < 0 then -1 else if i>0 then 1 @@ -77,6 +70,14 @@ let pow a b = pow 0 1 = 0 *) +module Infix = struct + include Pervasives + let (--) = range + let (--^) = range' + let ( ** ) = pow +end +include Infix + let floor_div a n = if a < 0 && n >= 0 then (a + 1) / n - 1 diff --git a/src/core/CCInt.mli b/src/core/CCInt.mli index 48ef8ac4..3c71caaf 100644 --- a/src/core/CCInt.mli +++ b/src/core/CCInt.mli @@ -126,6 +126,8 @@ module Infix : sig val (/) : t -> t -> t (** @since 2.1 *) + val ( ** ) : t -> t -> t + val (mod) : t -> t -> t (** @since 2.1 *) val (land) : t -> t -> t (** @since 2.1 *)