forked from ocaml-flambda/ocaml-jst
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnumbers.mli
125 lines (81 loc) · 2.93 KB
/
numbers.mli
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
(**************************************************************************)
(* *)
(* OCaml *)
(* *)
(* Pierre Chambart, OCamlPro *)
(* Mark Shinwell and Leo White, Jane Street Europe *)
(* *)
(* Copyright 2013--2016 OCamlPro SAS *)
(* Copyright 2014--2016 Jane Street Group LLC *)
(* *)
(* All rights reserved. This file is distributed under the terms of *)
(* the GNU Lesser General Public License version 2.1, with the *)
(* special exception on linking described in the file LICENSE. *)
(* *)
(**************************************************************************)
(** Modules about numbers, some of which satisfy {!Identifiable.S}.
{b Warning:} this module is unstable and part of
{{!Compiler_libs}compiler-libs}.
*)
module Int : sig
include Identifiable.S with type t = int
(** [zero_to_n n] is the set of numbers \{0, ..., n\} (inclusive). *)
val zero_to_n : int -> Set.t
val to_string : int -> string
end
module Int8 : sig
type t
val zero : t
val one : t
val of_int_exn : int -> t
val to_int : t -> int
val print : Format.formatter -> t -> unit
end
(** Do not use polymorphic comparison on the unsigned integer types. *)
module Uint8 : sig
type t
val print : Format.formatter -> t -> unit
val zero : t
val one : t
val of_nonnegative_int_exn : int -> t
val to_int : t -> int
end
module Int16 : sig
type t
val zero : t
val one : t
val of_int_exn : int -> t
val of_int64_exn : Int64.t -> t
val to_int : t -> int
val print : Format.formatter -> t -> unit
end
module Uint16 : sig
type t
val print : Format.formatter -> t -> unit
val of_nonnegative_int_exn : int -> t
val of_nonnegative_int64_exn : Int64.t -> t
val to_int : t -> int
end
module Uint32 : sig
type t
val print : Format.formatter -> t -> unit
val zero : t
val of_nonnegative_int_exn : int -> t
val of_nonnegative_int32_exn : Int32.t -> t
val of_nonnegative_int64_exn : Int64.t -> t
val to_int64 : t -> Int64.t
end
module Uint64 : sig
type t
val zero : t
val succ : t -> t
val of_uint8 : Uint8.t -> t
val of_uint16 : Uint16.t -> t
val of_uint32 : Uint32.t -> t
val of_nonnegative_int_exn : int -> t
val of_nonnegative_int32_exn : Int32.t -> t
val of_nonnegative_int64_exn : Int64.t -> t
val to_int64 : t -> Int64.t
include Identifiable.S with type t := t
end
module Float : Identifiable.S with type t = float