module Decimal:sig
..end
decimal
type alias provides more readable serializations to s-expressions, at
the cost of lower precision. For example:
# sexp_of_decimal 3.000000000001;;
- : Sexp.t = 3
# sexp_of_float 3.000000000001;;
- : Sexp.t = 3.0000000000010000889
Also, the decimal sexp-converter will fail when provided with nan
or infinity
.
# float_of_sexp (Sexp.Atom "nan");;
- : float = nan
# decimal_of_sexp (Sexp.Atom "nan");;
Exception:
(Sexplib.Conv.Of_sexp_error (Failure common.ml.Decimal_nan_or_inf) nan).
typet =
float
val compare : t -> t -> int
val t_of_sexp : Sexplib.Sexp.t -> t
val sexp_of_t : t -> Sexplib.Sexp.t
val bin_t : t Bin_prot.Type_class.t
val bin_read_t : t Bin_prot.Read_ml.reader
val bin_read_t_ : t Bin_prot.Unsafe_read_c.reader
val bin_read_t__ : (int -> t) Bin_prot.Unsafe_read_c.reader
val bin_reader_t : t Bin_prot.Type_class.reader
val bin_size_t : t Bin_prot.Size.sizer
val bin_write_t : t Bin_prot.Write_ml.writer
val bin_write_t_ : t Bin_prot.Unsafe_write_c.writer
val bin_writer_t : t Bin_prot.Type_class.writer