5
5
include module type of Int
6
6
(* * @inline *)
7
7
8
- type t = int
9
-
10
- val zero : t
11
- (* * [zero] is the integer [0].
12
- @since 3.0 *)
13
-
14
- val one : t
15
- (* * [one] is the integer [1].
16
- @since 3.0 *)
17
-
18
- val minus_one : t
19
- (* * [minus_one] is the integer [-1].
20
- @since 3.0 *)
21
-
22
- val add : t -> t -> t
23
- (* * [add x y] is [x + y].
24
- @since 3.0 *)
25
-
26
- val sub : t -> t -> t
27
- (* * [sub x y] is [x - y].
28
- @since 3.0 *)
29
-
30
- val mul : t -> t -> t
31
- (* * [mul x y] is [x * y].
32
- @since 3.0 *)
33
-
34
- val div : t -> t -> t
35
- (* * [div x y] is [x / y]
36
- @since 3.0 *)
37
-
38
- val succ : t -> t
39
- (* * [succ x] is [x + 1].
40
- @since 3.0 *)
41
-
42
- val pred : t -> t
43
- (* * [pred x] is [x - 1].
44
- @since 3.0 *)
45
-
46
- val abs : t -> t
47
- (* * [abs x] is the absolute value of [x]. It is [x] if [x] is positive
48
- and [neg x] otherwise.
49
- @since 3.0 *)
50
-
51
- val max_int : t
52
- (* * [max_int] is the maximum integer.
53
- @since 3.0 *)
54
-
55
- val min_int : t
56
- (* * [min_int] is the minimum integer.
57
- @since 3.0 *)
58
-
59
- val compare : t -> t -> int
60
- (* * [compare x y] is the comparison function for integers
61
- with the same specification as {!Stdlib.compare}. *)
62
-
63
- val equal : t -> t -> bool
64
- (* * [equal x y] is [true] iff [x] and [y] are equal.
65
- Equality function for integers. *)
66
-
67
8
val hash : t -> int
68
9
(* * [hash x] computes the hash of [x]. *)
69
10
70
11
val sign : t -> int
71
12
(* * [sign x] return [0] if [x = 0], [-1] if [x < 0] and [1] if [x > 0].
72
13
Same as [compare x 0].*)
73
14
74
- val neg : t -> t
75
- (* * [neg x] is [- x].
76
- Unary negation.
77
- @since 0.5 *)
78
-
79
15
val pow : t -> t -> t
80
16
(* * [pow base exponent] returns [base] raised to the power of [exponent].
81
17
[pow x y = x^y] for positive integers [x] and [y].
@@ -103,22 +39,6 @@ val random_range : int -> int -> t random_gen
103
39
val pp : t printer
104
40
(* * [pp ppf x] prints the integer [x] on [ppf]. *)
105
41
106
- val to_float : t -> float
107
- (* * [to_float] is the same as [float_of_int]
108
- @since 3.0*)
109
-
110
- [@@@ ocaml.warning " -32" ]
111
-
112
- val of_float : float -> t
113
- (* * [to_float] is the same as [int_of_float]
114
- @since 3.0*)
115
-
116
- [@@@ ocaml.warning " +32" ]
117
-
118
- val to_string : t -> string
119
- (* * [to_string x] returns the string representation of the integer [x], in signed decimal.
120
- @since 0.13 *)
121
-
122
42
val of_string : string -> t option
123
43
(* * [of_string s] converts the given string [s] into an integer.
124
44
Safe version of {!of_string_exn}.
@@ -130,11 +50,6 @@ val of_string_exn : string -> t
130
50
@raise Failure in case of failure.
131
51
@since 3.0 *)
132
52
133
- val of_float : float -> t
134
- (* * [of_float x] converts the given floating-point number [x] to an integer.
135
- Alias to {!int_of_float}.
136
- @since 3.0 *)
137
-
138
53
val pp_binary : t printer
139
54
(* * [pp_binary ppf x] prints [x] on [ppf].
140
55
Print as "0b00101010".
@@ -173,34 +88,6 @@ val popcount : t -> int
173
88
(* * Number of bits set to 1
174
89
@since 3.0 *)
175
90
176
- val logand : t -> t -> t
177
- (* * [logand] is the same as [(land)].
178
- @since 3.0 *)
179
-
180
- val logor : t -> t -> t
181
- (* * [logand] is the same as [(lor)].
182
- @since 3.0 *)
183
-
184
- val logxor : t -> t -> t
185
- (* * [logxor] is the same as [(lxor)].
186
- @since 3.0 *)
187
-
188
- val lognot : t -> t
189
- (* * [logand] is the same as [lnot].
190
- @since 3.0 *)
191
-
192
- val shift_left : t -> int -> t
193
- (* * [shift_left] is the same as [(lsl)].
194
- @since 3.0 *)
195
-
196
- val shift_right : t -> int -> t
197
- (* * [shift_right] is the same as [(asr)].
198
- @since 3.0 *)
199
-
200
- val shift_right_logical : t -> int -> t
201
- (* * [shift_right_logical] is the same as [(lsr)].
202
- @since 3.0 *)
203
-
204
91
(* * {2 Infix Operators}
205
92
206
93
@since 0.17 *)
0 commit comments