Binary serialization of OCaml numeric types to and from strings