[bugfix in data_encoding] When reading a float (from binary format), MBytes.get_double should be used instead of MBytes.get_float (Float _ encodes doubles in the encoding, not singles)

This commit is contained in:
OCamlPro-Iguernlala 2017-03-29 18:02:19 +02:00
parent 66cb6a8567
commit f96fbe7d31

View File

@ -1033,8 +1033,10 @@ let rec length : type x. x t -> x -> int = fun e ->
let int64 buf ofs _len =
ofs + Size.int64, MBytes.get_int64 buf ofs
(** read a float64 (double) **)
let float buf ofs _len =
ofs + Size.float, MBytes.get_float buf ofs
(* Here, float means float64, which is read using MBytes.get_double !! *)
ofs + Size.float, MBytes.get_double buf ofs
let int_of_int32 i =
let i' = Int32.to_int i in