[bugfix in data_encoding] When writing a float (to binary format), MBytes.set_double should be used instead of MBytes.set_float (Float _ encodes doubles in the encoding, not singles)
This commit is contained in:
parent
f96fbe7d31
commit
dc32decd05
@ -876,8 +876,10 @@ let rec length : type x. x t -> x -> int = fun e ->
|
|||||||
MBytes.set_int64 buf ofs v;
|
MBytes.set_int64 buf ofs v;
|
||||||
ofs + Size.int64
|
ofs + Size.int64
|
||||||
|
|
||||||
|
(** write a float64 (double) **)
|
||||||
let float v buf ofs =
|
let float v buf ofs =
|
||||||
MBytes.set_float buf ofs v;
|
(*Here, float means float64, which is written using MBytes.set_double !!*)
|
||||||
|
MBytes.set_double buf ofs v;
|
||||||
ofs + Size.float
|
ofs + Size.float
|
||||||
|
|
||||||
let fixed_kind_bytes length s buf ofs =
|
let fixed_kind_bytes length s buf ofs =
|
||||||
|
Loading…
Reference in New Issue
Block a user