• en

Module Sexplib_num

module Sexplib_num_conv : sig
val sexp_of_big_int : Big_int.big_int -> Sexplib.Sexp.t
sexp_of_big_int n converts the value n of type Big_int.big_int to an S-expression.
val sexp_of_nat : Nat.nat -> Sexplib.Sexp.t
sexp_of_nat n converts the value n of type Nat.nat to an S-expression.
val sexp_of_ratio : Ratio.ratio -> Sexplib.Sexp.t
sexp_of_ratio n converts the value n of type Ratio.ratio to an S-expression.
val sexp_of_num : Num.num -> Sexplib.Sexp.t
sexp_of_num n converts the value n of type Num.num to an S-expression.
val big_int_of_sexp : Sexplib.Sexp.t -> Big_int.big_int
big_int_of_sexp sexp converts S-expression sexp to a value of type Big_int.big_int.
val nat_of_sexp : Sexplib.Sexp.t -> Nat.nat
nat_of_sexp sexp converts S-expression sexp to a value of type Nat.nat.
val ratio_of_sexp : Sexplib.Sexp.t -> Ratio.ratio
ratio_of_sexp sexp converts S-expression sexp to a value of type Nat.ratio.
val num_of_sexp : Sexplib.Sexp.t -> Num.num
num_of_sexp sexp converts S-expression sexp to a value of type Nat.num.
end
module Std : sig
module Big_int : sig
type big_int = Big_int.big_int
val zero_big_int : big_int
val unit_big_int : big_int
val minus_big_int : big_int -> big_int
val abs_big_int : big_int -> big_int
val add_big_int : big_int -> big_int -> big_int
val succ_big_int : big_int -> big_int
val add_int_big_int : int -> big_int -> big_int
val sub_big_int : big_int -> big_int -> big_int
val pred_big_int : big_int -> big_int
val mult_big_int : big_int -> big_int -> big_int
val mult_int_big_int : int -> big_int -> big_int
val square_big_int : big_int -> big_int
val sqrt_big_int : big_int -> big_int
val quomod_big_int : big_int -> big_int -> (big_int * big_int)
val div_big_int : big_int -> big_int -> big_int
val mod_big_int : big_int -> big_int -> big_int
val gcd_big_int : big_int -> big_int -> big_int
val power_int_positive_int : int -> int -> big_int
val power_big_int_positive_int : big_int -> int -> big_int
val power_int_positive_big_int : int -> big_int -> big_int
val power_big_int_positive_big_int : big_int -> big_int -> big_int
val sign_big_int : big_int -> int
val compare_big_int : big_int -> big_int -> int
val eq_big_int : big_int -> big_int -> bool
val le_big_int : big_int -> big_int -> bool
val ge_big_int : big_int -> big_int -> bool
val lt_big_int : big_int -> big_int -> bool
val gt_big_int : big_int -> big_int -> bool
val max_big_int : big_int -> big_int -> big_int
val min_big_int : big_int -> big_int -> big_int
val num_digits_big_int : big_int -> int
val string_of_big_int : big_int -> string
val big_int_of_string : string -> big_int
val big_int_of_int : int -> big_int
val is_int_big_int : big_int -> bool
val int_of_big_int : big_int -> int
val big_int_of_int32 : int32 -> big_int
val big_int_of_nativeint : nativeint -> big_int
val big_int_of_int64 : int64 -> big_int
val int32_of_big_int : big_int -> int32
val nativeint_of_big_int : big_int -> nativeint
val int64_of_big_int : big_int -> int64
val float_of_big_int : big_int -> float
val and_big_int : big_int -> big_int -> big_int
val or_big_int : big_int -> big_int -> big_int
val xor_big_int : big_int -> big_int -> big_int
val shift_left_big_int : big_int -> int -> big_int
val shift_right_big_int : big_int -> int -> big_int
val shift_right_towards_zero_big_int : big_int -> int -> big_int
val extract_big_int : big_int -> int -> int -> big_int
val nat_of_big_int : big_int -> Nat.nat
val big_int_of_nat : Nat.nat -> big_int
val base_power_big_int : int -> int -> big_int -> big_int
val sys_big_int_of_string : string -> int -> int -> big_int
val round_futur_last_digit : bytes -> int -> int -> bool
val approx_big_int : int -> big_int -> string
val sexp_of_big_int : Big_int.big_int -> Sexplib.Sexp.t
val big_int_of_sexp : Sexplib.Sexp.t -> Big_int.big_int
end
module Nat : sig
type nat = Nat.nat
val create_nat : int -> nat
val make_nat : int -> nat
val set_to_zero_nat : nat -> int -> int -> unit
val blit_nat : nat -> int -> nat -> int -> int -> unit
val copy_nat : nat -> int -> int -> nat
val set_digit_nat : nat -> int -> int -> unit
val nth_digit_nat : nat -> int -> int
val set_digit_nat_native : nat -> int -> nativeint -> unit
val nth_digit_nat_native : nat -> int -> nativeint
val length_nat : nat -> int
val num_digits_nat : nat -> int -> int -> int
val num_leading_zero_bits_in_digit : nat -> int -> int
val is_digit_int : nat -> int -> bool
val is_digit_zero : nat -> int -> bool
val is_digit_normalized : nat -> int -> bool
val is_digit_odd : nat -> int -> bool
val is_zero_nat : nat -> int -> int -> bool
val is_nat_int : nat -> int -> int -> bool
val int_of_nat : nat -> int
val nat_of_int : int -> nat
val incr_nat : nat -> int -> int -> int -> int
val add_nat : nat -> int -> int -> nat -> int -> int -> int -> int
val complement_nat : nat -> int -> int -> unit
val decr_nat : nat -> int -> int -> int -> int
val sub_nat : nat -> int -> int -> nat -> int -> int -> int -> int
val mult_digit_nat : nat -> int -> int -> nat -> int -> int -> nat -> int -> int
val mult_nat : nat -> int -> int -> nat -> int -> int -> nat -> int -> int -> int
val square_nat : nat -> int -> int -> nat -> int -> int -> int
val shift_left_nat : nat -> int -> int -> nat -> int -> int -> unit
val div_digit_nat : nat -> int -> nat -> int -> nat -> int -> int -> nat -> int -> unit
val div_nat : nat -> int -> int -> nat -> int -> int -> unit
val shift_right_nat : nat -> int -> int -> nat -> int -> int -> unit
val compare_digits_nat : nat -> int -> nat -> int -> int
val compare_nat : nat -> int -> int -> nat -> int -> int -> int
val eq_nat : nat -> int -> int -> nat -> int -> int -> bool
val le_nat : nat -> int -> int -> nat -> int -> int -> bool
val lt_nat : nat -> int -> int -> nat -> int -> int -> bool
val ge_nat : nat -> int -> int -> nat -> int -> int -> bool
val gt_nat : nat -> int -> int -> nat -> int -> int -> bool
val land_digit_nat : nat -> int -> nat -> int -> unit
val lor_digit_nat : nat -> int -> nat -> int -> unit
val lxor_digit_nat : nat -> int -> nat -> int -> unit
val gcd_nat : nat -> int -> int -> nat -> int -> int -> int
val sqrt_nat : nat -> int -> int -> nat
val string_of_nat : nat -> string
val nat_of_string : string -> nat
val sys_nat_of_string : int -> string -> int -> int -> nat
val float_of_nat : nat -> float
val make_power_base : int -> nat -> (int * int)
val power_base_int : int -> int -> nat
val length_of_digit : int
val sexp_of_nat : Nat.nat -> Sexplib.Sexp.t
val nat_of_sexp : Sexplib.Sexp.t -> Nat.nat
end
module Ratio : sig
type ratio = Ratio.ratio
val null_denominator : ratio -> bool
val numerator_ratio : ratio -> Big_int.big_int
val denominator_ratio : ratio -> Big_int.big_int
val sign_ratio : ratio -> int
val normalize_ratio : ratio -> ratio
val cautious_normalize_ratio : ratio -> ratio
val cautious_normalize_ratio_when_printing : ratio -> ratio
val create_ratio : Big_int.big_int -> Big_int.big_int -> ratio
val create_normalized_ratio : Big_int.big_int -> Big_int.big_int -> ratio
val is_normalized_ratio : ratio -> bool
val report_sign_ratio : ratio -> Big_int.big_int -> Big_int.big_int
val abs_ratio : ratio -> ratio
val is_integer_ratio : ratio -> bool
val add_ratio : ratio -> ratio -> ratio
val minus_ratio : ratio -> ratio
val add_int_ratio : int -> ratio -> ratio
val add_big_int_ratio : Big_int.big_int -> ratio -> ratio
val sub_ratio : ratio -> ratio -> ratio
val mult_ratio : ratio -> ratio -> ratio
val mult_int_ratio : int -> ratio -> ratio
val mult_big_int_ratio : Big_int.big_int -> ratio -> ratio
val square_ratio : ratio -> ratio
val inverse_ratio : ratio -> ratio
val div_ratio : ratio -> ratio -> ratio
val integer_ratio : ratio -> Big_int.big_int
val floor_ratio : ratio -> Big_int.big_int
val round_ratio : ratio -> Big_int.big_int
val ceiling_ratio : ratio -> Big_int.big_int
val eq_ratio : ratio -> ratio -> bool
val compare_ratio : ratio -> ratio -> int
val lt_ratio : ratio -> ratio -> bool
val le_ratio : ratio -> ratio -> bool
val gt_ratio : ratio -> ratio -> bool
val ge_ratio : ratio -> ratio -> bool
val max_ratio : ratio -> ratio -> ratio
val min_ratio : ratio -> ratio -> ratio
val eq_big_int_ratio : Big_int.big_int -> ratio -> bool
val compare_big_int_ratio : Big_int.big_int -> ratio -> int
val lt_big_int_ratio : Big_int.big_int -> ratio -> bool
val le_big_int_ratio : Big_int.big_int -> ratio -> bool
val gt_big_int_ratio : Big_int.big_int -> ratio -> bool
val ge_big_int_ratio : Big_int.big_int -> ratio -> bool
val int_of_ratio : ratio -> int
val ratio_of_int : int -> ratio
val ratio_of_nat : Nat.nat -> ratio
val nat_of_ratio : ratio -> Nat.nat
val ratio_of_big_int : Big_int.big_int -> ratio
val big_int_of_ratio : ratio -> Big_int.big_int
val div_int_ratio : int -> ratio -> ratio
val div_ratio_int : ratio -> int -> ratio
val div_big_int_ratio : Big_int.big_int -> ratio -> ratio
val div_ratio_big_int : ratio -> Big_int.big_int -> ratio
val approx_ratio_fix : int -> ratio -> string
val approx_ratio_exp : int -> ratio -> string
val float_of_rational_string : ratio -> string
val string_of_ratio : ratio -> string
val ratio_of_string : string -> ratio
val float_of_ratio : ratio -> float
val power_ratio_positive_int : ratio -> int -> ratio
val power_ratio_positive_big_int : ratio -> Big_int.big_int -> ratio
val sexp_of_ratio : Ratio.ratio -> Sexplib.Sexp.t
val ratio_of_sexp : Sexplib.Sexp.t -> Ratio.ratio
end
module Num : sig
type num = Num.num =
| Int of int
| Big_int of Big_int.big_int
| Ratio of Ratio.ratio
val (+/) : num -> num -> num
val add_num : num -> num -> num
val minus_num : num -> num
val (-/) : num -> num -> num
val sub_num : num -> num -> num
val (*/) : num -> num -> num
val mult_num : num -> num -> num
val square_num : num -> num
val (//) : num -> num -> num
val div_num : num -> num -> num
val quo_num : num -> num -> num
val mod_num : num -> num -> num
val (**/) : num -> num -> num
val power_num : num -> num -> num
val abs_num : num -> num
val succ_num : num -> num
val pred_num : num -> num
val incr_num : num Pervasives.ref -> unit
val decr_num : num Pervasives.ref -> unit
val is_integer_num : num -> bool
val integer_num : num -> num
val floor_num : num -> num
val round_num : num -> num
val ceiling_num : num -> num
val sign_num : num -> int
val (=/) : num -> num -> bool
val (</) : num -> num -> bool
val (>/) : num -> num -> bool
val (<=/) : num -> num -> bool
val (>=/) : num -> num -> bool
val (<>/) : num -> num -> bool
val eq_num : num -> num -> bool
val lt_num : num -> num -> bool
val le_num : num -> num -> bool
val gt_num : num -> num -> bool
val ge_num : num -> num -> bool
val compare_num : num -> num -> int
val max_num : num -> num -> num
val min_num : num -> num -> num
val string_of_num : num -> string
val approx_num_fix : int -> num -> string
val approx_num_exp : int -> num -> string
val num_of_string : string -> num
val int_of_num : num -> int
val num_of_int : int -> num
val nat_of_num : num -> Nat.nat
val num_of_nat : Nat.nat -> num
val num_of_big_int : Big_int.big_int -> num
val big_int_of_num : num -> Big_int.big_int
val ratio_of_num : num -> Ratio.ratio
val num_of_ratio : Ratio.ratio -> num
val float_of_num : num -> float
val sexp_of_num : Num.num -> Sexplib.Sexp.t
val num_of_sexp : Sexplib.Sexp.t -> Num.num
end
end