On Tuesday 21 November 2006 12:05, drehman27 wrote:
> but OCaml only has 31 bit signed ints.
No. Look at Int32, Int64 and Big_int, for example.
> Why doesn't OCaml read back data in the same format?
RTFM:
val output_binary_int : out_channel -> int -> unit
(** Write one integer in binary format (4 bytes, big-endian)
on the given output channel.
The given integer is taken modulo 2{^32}.
The only reliable way to read it back is through the
{!Pervasives.input_binary_int} function. The format is compatible across
all machines for a given version of Objective Caml. *)
--
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
Objective CAML for Scientists
http://www.ffconsultancy.com/products/ocaml_for_scientists
.