12
12
(***********************************************************************)
14
(* $Id: big_int.mli,v 1.10 2002/03/14 20:12:54 xleroy Exp $ *)
14
(* $Id: big_int.mli,v 1.11 2008/01/04 13:15:52 xleroy Exp $ *)
16
16
(** Operations on arbitrary-precision integers.
128
128
(** Convert a big integer to a small integer (type [int]).
129
129
Raises [Failure "int_of_big_int"] if the big integer
130
130
is not representable as a small integer. *)
132
val big_int_of_int32 : int32 -> big_int
133
(** Convert a 32-bit integer to a big integer. *)
134
val big_int_of_nativeint : nativeint -> big_int
135
(** Convert a native integer to a big integer. *)
136
val big_int_of_int64 : int64 -> big_int
137
(** Convert a 64-bit integer to a big integer. *)
138
val int32_of_big_int : big_int -> int32
139
(** Convert a big integer to a 32-bit integer.
140
Raises [Failure] if the big integer is outside the
141
range [[-2{^31}, 2{^31}-1]]. *)
142
val nativeint_of_big_int : big_int -> nativeint
143
(** Convert a big integer to a native integer.
144
Raises [Failure] if the big integer is outside the
145
range [[Nativeint.min_int, Nativeint.max_int]]. *)
146
val int64_of_big_int : big_int -> int64
147
(** Convert a big integer to a 64-bit integer.
148
Raises [Failure] if the big integer is outside the
149
range [[-2{^63}, 2{^63}-1]]. *)
131
151
val float_of_big_int : big_int -> float
132
152
(** Returns a floating-point number approximating the
133
153
given big integer. *)