Skip to content

Commit 4781e0b

Browse files
committed
CCInt(chore): conditionally define function existing in newer OCaml
1 parent 881af12 commit 4781e0b

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/core/CCInt.ml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,13 @@ end
102102

103103
include Infix
104104

105+
[@@@iflt 4.13]
106+
105107
let min : t -> t -> t = Stdlib.min
106108
let max : t -> t -> t = Stdlib.max
107109

110+
[@@@endif]
111+
108112
let floor_div a n =
109113
if a < 0 && n >= 0 then
110114
((a + 1) / n) - 1

src/core/CCInt.mli

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ val to_string_binary : t -> string
5959
(** [to_string_binary x] returns the string representation of the integer [x], in binary.
6060
@since 0.20 *)
6161

62+
[@@@iflt 4.13]
63+
6264
val min : t -> t -> t
6365
(** [min x y] returns the minimum of the two integers [x] and [y].
6466
@since 0.17 *)
@@ -67,6 +69,8 @@ val max : t -> t -> t
6769
(** [max x y] returns the maximum of the two integers [x] and [y].
6870
@since 0.17 *)
6971

72+
[@@@endif]
73+
7074
val range_by : step:t -> t -> t -> t iter
7175
(** [range_by ~step i j] iterates on integers from [i] to [j] included,
7276
where the difference between successive elements is [step].

0 commit comments

Comments
 (0)