DecimalArbitrary precision real numbers
val pp_print_decimal : Stdlib.Format.formatter -> t -> unitPretty-print a rational
val pp_print_decimal_as_float : Stdlib.Format.formatter -> t -> unitPretty-print a rational as an f64 (used by compilation to Rust)
val pp_print_decimal_as_lus_real : Stdlib.Format.formatter -> t -> unitPretty-print a rational as a Lustre real
val pp_print_decimal_approximation : Stdlib.Format.formatter -> t -> unitPretty-print a rational in scientific format with the error magnitude
val pp_print_decimal_sexpr : Stdlib.Format.formatter -> t -> unitPretty-print a rational as an S-expression
val pp_print_decimal_as_json : Stdlib.Format.formatter -> t -> unitval string_of_decimal : t -> stringReturn a string representation of a rational
val string_of_decimal_sexpr : t -> stringReturn an S-expression string representation of a rational
val string_of_decimal_lustre : t -> stringReturn a Lustre string representation of a rational
val of_int : int -> tConvert an integer to a rational
val of_big_int : Big_int.big_int -> tConvert an arbitrary large integer to a rational
val of_num : Num.num -> tConvert an ocaml Num to a rational
val of_string : string -> tConvert a string in floating-point notation 1.2E3 to rational number
val of_rational_string : string -> tConvert a string of an integer or of a fraction p/q to a rational number.
Unlike Num.num_of_string, this does not temporarily modify the global normalization flags of the num library, which is not safe when several domains use the library.
val to_int : t -> intConvert a rational number to a rational
Truncates the rational number to an integer and raises the exception Failure "int_of_big_int" if the numeral cannot be represented as an integer.
val to_big_int : t -> Big_int.big_intConvert a rational number to an arbitrary large integer
val is_int : t -> boolReturn true if decimal coincides with an integer
val sign : t -> intReturns 0 on zero, 1 for positives and -1 for negatives. Works also on infinites but fails on undefined.
val epsilon : int -> tReturns the rational 2^p with signed p.
val magnitude : t -> intReturns a signed integer n such that 2^(n-1) < |dec| < 2^n or 0 if dec is null.
val zero : tThe rational number zero
val one : tThe rational number one