`sig
type rounding_mode = GMP_RNDN | GMP_RNDZ | GMP_RNDU | GMP_RNDD
module RNG :
sig
type randstate_t
and randalg_t = GMP_RAND_ALG_LC of int
val randinit : Gmp.RNG.randalg_t -> Gmp.RNG.randstate_t
val default : Gmp.RNG.randstate_t
end
module Z2 :
sig
type t
external from_int : dest:Gmp.Z2.t -> int -> unit = "_mlgmp_z2_from_int"
external from_string_base : dest:Gmp.Z2.t -> base:int -> string -> unit
= "_mlgmp_z2_from_string_base"
external from_float : dest:Gmp.Z2.t -> float -> unit
= "_mlgmp_z2_from_float"
external create : unit -> Gmp.Z2.t = "_mlgmp_z_create"
external copy : dest:Gmp.Z2.t -> from:Gmp.Z2.t -> unit
= "_mlgmp_z2_copy"
external add : dest:Gmp.Z2.t -> Gmp.Z2.t -> Gmp.Z2.t -> unit
= "_mlgmp_z2_add"
external sub : dest:Gmp.Z2.t -> Gmp.Z2.t -> Gmp.Z2.t -> unit
= "_mlgmp_z2_sub"
external mul : dest:Gmp.Z2.t -> Gmp.Z2.t -> Gmp.Z2.t -> unit
= "_mlgmp_z2_mul"
external tdiv_q : dest:Gmp.Z2.t -> Gmp.Z2.t -> Gmp.Z2.t -> unit
= "_mlgmp_z2_tdiv_q"
external tdiv_r : dest:Gmp.Z2.t -> Gmp.Z2.t -> Gmp.Z2.t -> unit
= "_mlgmp_z2_tdiv_r"
external cdiv_q : dest:Gmp.Z2.t -> Gmp.Z2.t -> Gmp.Z2.t -> unit
= "_mlgmp_z2_cdiv_q"
external cdiv_r : dest:Gmp.Z2.t -> Gmp.Z2.t -> Gmp.Z2.t -> unit
= "_mlgmp_z2_cdiv_r"
external fdiv_q : dest:Gmp.Z2.t -> Gmp.Z2.t -> Gmp.Z2.t -> unit
= "_mlgmp_z2_fdiv_q"
external fdiv_r : dest:Gmp.Z2.t -> Gmp.Z2.t -> Gmp.Z2.t -> unit
= "_mlgmp_z2_fdiv_r"
external divexact : dest:Gmp.Z2.t -> Gmp.Z2.t -> Gmp.Z2.t -> unit
= "_mlgmp_z2_divexact"
external neg : dest:Gmp.Z2.t -> Gmp.Z2.t -> unit = "_mlgmp_z2_neg"
external abs : dest:Gmp.Z2.t -> Gmp.Z2.t -> unit = "_mlgmp_z2_abs"
end
module Z :
sig
type t = Gmp.Z2.t
external copy : Gmp.Z.t -> Gmp.Z.t = "_mlgmp_z_copy"
external from_int : int -> Gmp.Z.t = "_mlgmp_z_from_int"
external of_int : int -> Gmp.Z.t = "_mlgmp_z_from_int"
external from_string_base : base:int -> string -> Gmp.Z.t
= "_mlgmp_z_from_string_base"
external from_float : float -> Gmp.Z.t = "_mlgmp_z_from_float"
external of_float : float -> Gmp.Z.t = "_mlgmp_z_from_float"
external to_string_base : base:int -> Gmp.Z.t -> string
= "_mlgmp_z_to_string_base"
external to_int : Gmp.Z.t -> int = "_mlgmp_z_to_int"
external to_float : Gmp.Z.t -> float = "_mlgmp_z_to_float"
external int_from : Gmp.Z.t -> int = "_mlgmp_z_to_int"
external float_from : Gmp.Z.t -> float = "_mlgmp_z_to_float"
external add : Gmp.Z.t -> Gmp.Z.t -> Gmp.Z.t = "_mlgmp_z_add"
external sub : Gmp.Z.t -> Gmp.Z.t -> Gmp.Z.t = "_mlgmp_z_sub"
external mul : Gmp.Z.t -> Gmp.Z.t -> Gmp.Z.t = "_mlgmp_z_mul"
external add_ui : Gmp.Z.t -> int -> Gmp.Z.t = "_mlgmp_z_add_ui"
external sub_ui : Gmp.Z.t -> int -> Gmp.Z.t = "_mlgmp_z_sub_ui"
external mul_ui : Gmp.Z.t -> int -> Gmp.Z.t = "_mlgmp_z_mul_ui"
external neg : Gmp.Z.t -> Gmp.Z.t = "_mlgmp_z_neg"
external abs : Gmp.Z.t -> Gmp.Z.t = "_mlgmp_z_abs"
external tdiv_qr : Gmp.Z.t -> Gmp.Z.t -> Gmp.Z.t * Gmp.Z.t
= "_mlgmp_z_tdiv_qr"
external tdiv_q : Gmp.Z.t -> Gmp.Z.t -> Gmp.Z.t = "_mlgmp_z_tdiv_q"
external tdiv_r : Gmp.Z.t -> Gmp.Z.t -> Gmp.Z.t = "_mlgmp_z_tdiv_r"
external cdiv_qr : Gmp.Z.t -> Gmp.Z.t -> Gmp.Z.t * Gmp.Z.t
= "_mlgmp_z_cdiv_qr"
external cdiv_q : Gmp.Z.t -> Gmp.Z.t -> Gmp.Z.t = "_mlgmp_z_cdiv_q"
external cdiv_r : Gmp.Z.t -> Gmp.Z.t -> Gmp.Z.t = "_mlgmp_z_cdiv_r"
external fdiv_qr : Gmp.Z.t -> Gmp.Z.t -> Gmp.Z.t * Gmp.Z.t
= "_mlgmp_z_fdiv_qr"
external fdiv_q : Gmp.Z.t -> Gmp.Z.t -> Gmp.Z.t = "_mlgmp_z_fdiv_q"
external fdiv_r : Gmp.Z.t -> Gmp.Z.t -> Gmp.Z.t = "_mlgmp_z_fdiv_r"
external dmod : Gmp.Z.t -> Gmp.Z.t -> Gmp.Z.t = "_mlgmp_z_mod"
external dmod_ui : Gmp.Z.t -> int -> Gmp.Z.t = "_mlgmp_z_mod_ui"
external euclidean_division : Gmp.Z.t -> Gmp.Z.t -> Gmp.Z.t * Gmp.Z.t
= "_mlgmp_z_fdiv_qr"
external modulo : Gmp.Z.t -> Gmp.Z.t -> Gmp.Z.t = "_mlgmp_z_mod"
external tdiv_qr_ui : Gmp.Z.t -> int -> Gmp.Z.t * Gmp.Z.t
= "_mlgmp_z_tdiv_qr_ui"
external tdiv_q_ui : Gmp.Z.t -> int -> Gmp.Z.t = "_mlgmp_z_tdiv_q_ui"
external tdiv_r_ui : Gmp.Z.t -> int -> Gmp.Z.t = "_mlgmp_z_tdiv_r_ui"
external tdiv_ui : Gmp.Z.t -> int -> int = "_mlgmp_z_tdiv_ui"
external cdiv_qr_ui : Gmp.Z.t -> int -> Gmp.Z.t * Gmp.Z.t
= "_mlgmp_z_cdiv_qr_ui"
external cdiv_q_ui : Gmp.Z.t -> int -> Gmp.Z.t = "_mlgmp_z_cdiv_q_ui"
external cdiv_r_ui : Gmp.Z.t -> int -> Gmp.Z.t = "_mlgmp_z_cdiv_r_ui"
external cdiv_ui : Gmp.Z.t -> int -> int = "_mlgmp_z_cdiv_ui"
external fdiv_qr_ui : Gmp.Z.t -> int -> Gmp.Z.t * Gmp.Z.t
= "_mlgmp_z_fdiv_qr_ui"
external fdiv_q_ui : Gmp.Z.t -> int -> Gmp.Z.t = "_mlgmp_z_fdiv_q_ui"
external fdiv_r_ui : Gmp.Z.t -> int -> Gmp.Z.t = "_mlgmp_z_fdiv_r_ui"
external fdiv_ui : Gmp.Z.t -> int -> int = "_mlgmp_z_fdiv_ui"
external divexact : Gmp.Z.t -> Gmp.Z.t -> Gmp.Z.t = "_mlgmp_z_divexact"
external mul_2exp : Gmp.Z.t -> int -> Gmp.Z.t = "_mlgmp_z_mul_2exp"
external mul2exp : Gmp.Z.t -> int -> Gmp.Z.t = "_mlgmp_z_mul_2exp"
external tdiv_q_2exp : Gmp.Z.t -> int -> Gmp.Z.t
= "_mlgmp_z_tdiv_q_2exp"
external tdiv_r_2exp : Gmp.Z.t -> int -> Gmp.Z.t
= "_mlgmp_z_tdiv_r_2exp"
external fdiv_q_2exp : Gmp.Z.t -> int -> Gmp.Z.t
= "_mlgmp_z_fdiv_q_2exp"
external fdiv_r_2exp : Gmp.Z.t -> int -> Gmp.Z.t
= "_mlgmp_z_fdiv_r_2exp"
external cdiv_q_2exp : Gmp.Z.t -> int -> Gmp.Z.t
= "_mlgmp_z_cdiv_q_2exp"
external cdiv_r_2exp : Gmp.Z.t -> int -> Gmp.Z.t
= "_mlgmp_z_cdiv_r_2exp"
external powm : Gmp.Z.t -> Gmp.Z.t -> Gmp.Z.t -> Gmp.Z.t
= "_mlgmp_z_powm"
external powm_ui : Gmp.Z.t -> int -> Gmp.Z.t -> Gmp.Z.t
= "_mlgmp_z_powm_ui"
external pow_ui : Gmp.Z.t -> int -> Gmp.Z.t = "_mlgmp_z_pow_ui"
external ui_pow_ui : int -> int -> Gmp.Z.t = "_mlgmp_z_ui_pow_ui"
external pow_ui_ui : int -> int -> Gmp.Z.t = "_mlgmp_z_ui_pow_ui"
external sqrt : Gmp.Z.t -> Gmp.Z.t = "_mlgmp_z_sqrt"
external sqrtrem : Gmp.Z.t -> Gmp.Z.t * Gmp.Z.t = "_mlgmp_z_sqrtrem"
external root : Gmp.Z.t -> int -> Gmp.Z.t = "_mlgmp_z_root"
external perfect_power_p : Gmp.Z.t -> bool = "_mlgmp_z_perfect_power_p"
external perfect_square_p : Gmp.Z.t -> bool
= "_mlgmp_z_perfect_square_p"
external is_perfect_power : Gmp.Z.t -> bool
= "_mlgmp_z_perfect_power_p"
external is_perfect_square : Gmp.Z.t -> bool
= "_mlgmp_z_perfect_square_p"
external probab_prime_p : Gmp.Z.t -> int -> bool
= "_mlgmp_z_probab_prime_p"
external is_probab_prime : Gmp.Z.t -> int -> bool
= "_mlgmp_z_probab_prime_p"
external nextprime : Gmp.Z.t -> Gmp.Z.t = "_mlgmp_z_nextprime"
external gcd : Gmp.Z.t -> Gmp.Z.t -> Gmp.Z.t = "_mlgmp_z_gcd"
external gcd_ui : Gmp.Z.t -> Gmp.Z.t -> Gmp.Z.t = "_mlgmp_z_gcd_ui"
external lcm : Gmp.Z.t -> Gmp.Z.t -> Gmp.Z.t = "_mlgmp_z_lcm"
external gcdext : Gmp.Z.t -> Gmp.Z.t -> Gmp.Z.t * Gmp.Z.t * Gmp.Z.t
= "_mlgmp_z_gcdext"
external inverse : Gmp.Z.t -> Gmp.Z.t -> Gmp.Z.t option
= "_mlgmp_z_invert"
external legendre : Gmp.Z.t -> Gmp.Z.t -> int = "_mlgmp_z_legendre"
external jacobi : Gmp.Z.t -> Gmp.Z.t -> int = "_mlgmp_z_jacobi"
external kronecker_si : Gmp.Z.t -> int -> int = "_mlgmp_z_kronecker_si"
external si_kronecker : int -> Gmp.Z.t -> int = "_mlgmp_z_si_kronecker"
external remove : Gmp.Z.t -> Gmp.Z.t -> Gmp.Z.t * int
= "_mlgmp_z_remove"
external fac_ui : int -> Gmp.Z.t = "_mlgmp_z_fac_ui"
external fib_ui : int -> Gmp.Z.t = "_mlgmp_z_fib_ui"
external bin_ui : n:Gmp.Z.t -> k:int -> Gmp.Z.t = "_mlgmp_z_bin_ui"
external bin_uiui : n:int -> k:int -> Gmp.Z.t = "_mlgmp_z_bin_uiui"
external cmp : Gmp.Z.t -> Gmp.Z.t -> int = "_mlgmp_z_compare"
external cmp_si : Gmp.Z.t -> int -> int = "_mlgmp_z_compare_si"
external compare : Gmp.Z.t -> Gmp.Z.t -> int = "_mlgmp_z_compare"
external compare_si : Gmp.Z.t -> int -> int = "_mlgmp_z_compare_si"
external compare_int : Gmp.Z.t -> int -> int = "_mlgmp_z_compare_si"
external sgn : Gmp.Z.t -> int = "_mlgmp_z_sgn"
external band : Gmp.Z.t -> Gmp.Z.t -> Gmp.Z.t = "_mlgmp_z_and"
external bior : Gmp.Z.t -> Gmp.Z.t -> Gmp.Z.t = "_mlgmp_z_ior"
external bxor : Gmp.Z.t -> Gmp.Z.t -> Gmp.Z.t = "_mlgmp_z_xor"
external bcom : Gmp.Z.t -> Gmp.Z.t = "_mlgmp_z_com"
external popcount : Gmp.Z.t -> int = "_mlgmp_z_popcount"
external hamdist : Gmp.Z.t -> Gmp.Z.t -> int = "_mlgmp_z_hamdist"
external scan0 : Gmp.Z.t -> int -> int = "_mlgmp_z_scan0"
external scan1 : Gmp.Z.t -> int -> int = "_mlgmp_z_scan1"
external urandomb : state:Gmp.RNG.randstate_t -> nbits:int -> Gmp.Z.t
= "_mlgmp_z_urandomb"
external urandomm : state:Gmp.RNG.randstate_t -> n:Gmp.Z.t -> Gmp.Z.t
= "_mlgmp_z_urandomm"
external rrandomb : state:Gmp.RNG.randstate_t -> nbits:int -> Gmp.Z.t
= "_mlgmp_z_rrandomb"
val zero : Gmp.Z.t
val one : Gmp.Z.t
val is_prime : ?prec:int -> Gmp.Z.t -> bool
val equal : Gmp.Z.t -> Gmp.Z.t -> bool
val equal_int : Gmp.Z.t -> int -> bool
val is_zero : Gmp.Z.t -> bool
val to_string : Gmp.Z.t -> string
val from_string : string -> Gmp.Z.t
val string_from : Gmp.Z.t -> string
val output : Stdlib.out_channel -> Gmp.Z.t -> unit
val sprintf : unit -> Gmp.Z.t -> string
val print : Stdlib.Format.formatter -> Gmp.Z.t -> unit
val succ : Gmp.Z.t -> Gmp.Z.t
val pred : Gmp.Z.t -> Gmp.Z.t
val min : Gmp.Z.t -> Gmp.Z.t -> Gmp.Z.t
val max : Gmp.Z.t -> Gmp.Z.t -> Gmp.Z.t
module Infixes :
sig
external ( +! ) : Gmp.Z.t -> Gmp.Z.t -> Gmp.Z.t = "_mlgmp_z_add"
external ( -! ) : Gmp.Z.t -> Gmp.Z.t -> Gmp.Z.t = "_mlgmp_z_sub"
external ( *! ) : Gmp.Z.t -> Gmp.Z.t -> Gmp.Z.t = "_mlgmp_z_mul"
external ( /! ) : Gmp.Z.t -> Gmp.Z.t -> Gmp.Z.t = "_mlgmp_z_fdiv_q"
external ( %! ) : Gmp.Z.t -> Gmp.Z.t -> Gmp.Z.t = "_mlgmp_z_fdiv_r"
val ( <! ) : Gmp.Z.t -> Gmp.Z.t -> bool
val ( <=! ) : Gmp.Z.t -> Gmp.Z.t -> bool
val ( =! ) : Gmp.Z.t -> Gmp.Z.t -> bool
val ( >=! ) : Gmp.Z.t -> Gmp.Z.t -> bool
val ( >! ) : Gmp.Z.t -> Gmp.Z.t -> bool
val ( <>! ) : Gmp.Z.t -> Gmp.Z.t -> bool
end
end
module Q :
sig
type t
external create : unit -> Gmp.Q.t = "_mlgmp_q_create"
external from_z : Gmp.Z.t -> Gmp.Q.t = "_mlgmp_q_from_z"
external from_si : int -> int -> Gmp.Q.t = "_mlgmp_q_from_si"
external from_ints : int -> int -> Gmp.Q.t = "_mlgmp_q_from_si"
val from_int : int -> Gmp.Q.t
external from_float : float -> Gmp.Q.t = "_mlgmp_q_from_float"
external float_from : Gmp.Q.t -> float = "_mlgmp_q_to_float"
external to_float : Gmp.Q.t -> float = "_mlgmp_q_to_float"
external add : Gmp.Q.t -> Gmp.Q.t -> Gmp.Q.t = "_mlgmp_q_add"
external sub : Gmp.Q.t -> Gmp.Q.t -> Gmp.Q.t = "_mlgmp_q_sub"
external mul : Gmp.Q.t -> Gmp.Q.t -> Gmp.Q.t = "_mlgmp_q_mul"
external div : Gmp.Q.t -> Gmp.Q.t -> Gmp.Q.t = "_mlgmp_q_div"
external neg : Gmp.Q.t -> Gmp.Q.t = "_mlgmp_q_neg"
external inv : Gmp.Q.t -> Gmp.Q.t = "_mlgmp_q_inv"
external get_num : Gmp.Q.t -> Gmp.Z.t = "_mlgmp_q_get_num"
external get_den : Gmp.Q.t -> Gmp.Z.t = "_mlgmp_q_get_den"
external cmp : Gmp.Q.t -> Gmp.Q.t -> int = "_mlgmp_q_cmp"
external compare : Gmp.Q.t -> Gmp.Q.t -> int = "_mlgmp_q_cmp"
external cmp_ui : Gmp.Q.t -> int -> int -> int = "_mlgmp_q_cmp_ui"
external sgn : Gmp.Q.t -> int = "_mlgmp_q_sgn"
val zero : Gmp.Q.t
val is_zero : Gmp.Q.t -> bool
val from_zs : Gmp.Z.t -> Gmp.Z.t -> Gmp.Q.t
val equal : Gmp.Q.t -> Gmp.Q.t -> bool
val output : Stdlib.out_channel -> Gmp.Q.t -> unit
val to_string : Gmp.Q.t -> string
val sprintf : unit -> Gmp.Q.t -> string
module Infixes :
sig
external ( +/ ) : Gmp.Q.t -> Gmp.Q.t -> Gmp.Q.t = "_mlgmp_q_add"
external ( -/ ) : Gmp.Q.t -> Gmp.Q.t -> Gmp.Q.t = "_mlgmp_q_sub"
external ( */ ) : Gmp.Q.t -> Gmp.Q.t -> Gmp.Q.t = "_mlgmp_q_mul"
external ( // ) : Gmp.Q.t -> Gmp.Q.t -> Gmp.Q.t = "_mlgmp_q_div"
val ( </ ) : Gmp.Q.t -> Gmp.Q.t -> bool
val ( <=/ ) : Gmp.Q.t -> Gmp.Q.t -> bool
val ( =/ ) : Gmp.Q.t -> Gmp.Q.t -> bool
val ( >=/ ) : Gmp.Q.t -> Gmp.Q.t -> bool
val ( >/ ) : Gmp.Q.t -> Gmp.Q.t -> bool
val ( <>/ ) : Gmp.Q.t -> Gmp.Q.t -> bool
end
end
module F :
sig
type t
val zero : Gmp.F.t
external create : unit -> Gmp.F.t = "_mlgmp_f_create"
val default_prec : int Stdlib.ref
external from_z_prec : prec:int -> Gmp.Z.t -> Gmp.F.t
= "_mlgmp_f_from_z"
external from_q_prec : prec:int -> Gmp.Z.t -> Gmp.F.t
= "_mlgmp_f_from_q"
external from_si_prec : prec:int -> int -> Gmp.F.t = "_mlgmp_f_from_si"
external from_float_prec : prec:int -> float -> Gmp.F.t
= "_mlgmp_f_from_float"
external from_string_prec_base :
prec:int -> base:int -> string -> Gmp.F.t = "_mlgmp_f_from_string"
external float_from : Gmp.F.t -> float = "_mlgmp_f_to_float"
external to_float : Gmp.F.t -> float = "_mlgmp_f_to_float"
external to_string_exp_base_digits :
base:int -> digits:int -> Gmp.F.t -> string * int
= "_mlgmp_f_to_string_exp_base_digits"
external add_prec : prec:int -> Gmp.F.t -> Gmp.F.t -> Gmp.F.t
= "_mlgmp_f_add"
external sub_prec : prec:int -> Gmp.F.t -> Gmp.F.t -> Gmp.F.t
= "_mlgmp_f_sub"
external mul_prec : prec:int -> Gmp.F.t -> Gmp.F.t -> Gmp.F.t
= "_mlgmp_f_mul"
external div_prec : prec:int -> Gmp.F.t -> Gmp.F.t -> Gmp.F.t
= "_mlgmp_f_div"
external add_prec_ui : prec:int -> Gmp.F.t -> int -> Gmp.F.t
= "_mlgmp_f_add_ui"
external sub_prec_ui : prec:int -> Gmp.F.t -> int -> Gmp.F.t
= "_mlgmp_f_sub_ui"
external mul_prec_ui : prec:int -> Gmp.F.t -> int -> Gmp.F.t
= "_mlgmp_f_mul_ui"
external div_prec_ui : prec:int -> Gmp.F.t -> int -> Gmp.F.t
= "_mlgmp_f_div_ui"
external neg_prec : prec:int -> Gmp.F.t -> Gmp.F.t = "_mlgmp_f_neg"
external abs_prec : prec:int -> Gmp.F.t -> Gmp.F.t = "_mlgmp_f_abs"
external inv_prec : prec:int -> Gmp.F.t -> Gmp.F.t = "_mlgmp_f_div"
external reldiff_prec : prec:int -> Gmp.F.t -> Gmp.F.t
= "_mlgmp_f_reldiff"
external floor_prec : prec:int -> Gmp.F.t -> Gmp.F.t = "_mlgmp_f_floor"
external ceil_prec : prec:int -> Gmp.F.t -> Gmp.F.t = "_mlgmp_f_ceil"
external trunc_prec : prec:int -> Gmp.F.t -> Gmp.F.t = "_mlgmp_f_trunc"
val from_z : Gmp.Z.t -> Gmp.F.t
val from_q : Gmp.Z.t -> Gmp.F.t
val from_si : int -> Gmp.F.t
val from_int : int -> Gmp.F.t
val from_float : float -> Gmp.F.t
val from_string_base : base:int -> string -> Gmp.F.t
val from_string : string -> Gmp.F.t
val add : Gmp.F.t -> Gmp.F.t -> Gmp.F.t
val sub : Gmp.F.t -> Gmp.F.t -> Gmp.F.t
val mul : Gmp.F.t -> Gmp.F.t -> Gmp.F.t
val div : Gmp.F.t -> Gmp.F.t -> Gmp.F.t
val reldiff : Gmp.F.t -> Gmp.F.t
val add_ui : Gmp.F.t -> int -> Gmp.F.t
val sub_ui : Gmp.F.t -> int -> Gmp.F.t
val mul_ui : Gmp.F.t -> int -> Gmp.F.t
val div_ui : Gmp.F.t -> int -> Gmp.F.t
val neg : Gmp.F.t -> Gmp.F.t
val abs : Gmp.F.t -> Gmp.F.t
val inv : Gmp.F.t -> Gmp.F.t
val floor : Gmp.F.t -> Gmp.F.t
val ceil : Gmp.F.t -> Gmp.F.t
val trunc : Gmp.F.t -> Gmp.F.t
external cmp : Gmp.F.t -> Gmp.F.t -> int = "_mlgmp_f_cmp"
external compare : Gmp.F.t -> Gmp.F.t -> int = "_mlgmp_f_cmp"
external sgn : Gmp.F.t -> int = "_mlgmp_f_sgn"
external eq : Gmp.F.t -> Gmp.F.t -> prec:int -> bool = "_mlgmp_f_eq"
external urandomb_prec :
prec:int -> state:Gmp.RNG.randstate_t -> nbits:int -> Gmp.F.t
= "_mlgmp_f_urandomb"
external random2 : prec:int -> nlimbs:int -> max_exp:int -> Gmp.F.t
= "_mlgmp_f_random2"
val urandomb : state:Gmp.RNG.randstate_t -> nbits:int -> Gmp.F.t
val equal : Gmp.F.t -> Gmp.F.t -> bool
val to_string_base_digits : base:int -> digits:int -> Gmp.F.t -> string
val to_string : Gmp.F.t -> string
end
module FR :
sig
type t
val zero : Gmp.FR.t
external create_prec : prec:int -> unit -> Gmp.FR.t
= "_mlgmp_fr_create"
val create : unit -> Gmp.FR.t
val default_prec : int Stdlib.ref
external from_z_prec :
prec:int -> mode:Gmp.rounding_mode -> Gmp.Z.t -> Gmp.FR.t
= "_mlgmp_fr_from_z"
external from_q_prec :
prec:int -> mode:Gmp.rounding_mode -> Gmp.Z.t -> Gmp.FR.t
= "_mlgmp_fr_from_z"
external from_si_prec :
prec:int -> mode:Gmp.rounding_mode -> int -> Gmp.FR.t
= "_mlgmp_fr_from_si"
external from_float_prec :
prec:int -> mode:Gmp.rounding_mode -> float -> Gmp.FR.t
= "_mlgmp_fr_from_float"
external float_from : Gmp.FR.t -> float = "_mlgmp_fr_to_float"
external to_float_mode : mode:Gmp.rounding_mode -> Gmp.FR.t -> float
= "_mlgmp_fr_to_float"
external from_string_prec_base :
prec:int -> mode:Gmp.rounding_mode -> base:int -> string -> Gmp.FR.t
= "_mlgmp_fr_from_string"
external to_string_exp_base_digits :
mode:Gmp.rounding_mode ->
base:int -> digits:int -> Gmp.FR.t -> string * int
= "_mlgmp_fr_to_string_exp_base_digits"
external add_prec :
prec:int ->
mode:Gmp.rounding_mode -> Gmp.FR.t -> Gmp.FR.t -> Gmp.FR.t
= "_mlgmp_fr_add"
external sub_prec :
prec:int ->
mode:Gmp.rounding_mode -> Gmp.FR.t -> Gmp.FR.t -> Gmp.FR.t
= "_mlgmp_fr_sub"
external mul_prec :
prec:int ->
mode:Gmp.rounding_mode -> Gmp.FR.t -> Gmp.FR.t -> Gmp.FR.t
= "_mlgmp_fr_mul"
external div_prec :
prec:int ->
mode:Gmp.rounding_mode -> Gmp.FR.t -> Gmp.FR.t -> Gmp.FR.t
= "_mlgmp_fr_div"
external add_prec_ui :
prec:int -> mode:Gmp.rounding_mode -> Gmp.FR.t -> int -> Gmp.FR.t
= "_mlgmp_fr_add_ui"
external sub_prec_ui :
prec:int -> mode:Gmp.rounding_mode -> Gmp.FR.t -> int -> Gmp.FR.t
= "_mlgmp_fr_sub_ui"
external mul_prec_ui :
prec:int -> mode:Gmp.rounding_mode -> Gmp.FR.t -> int -> Gmp.FR.t
= "_mlgmp_fr_mul_ui"
external div_prec_ui :
prec:int -> mode:Gmp.rounding_mode -> Gmp.FR.t -> int -> Gmp.FR.t
= "_mlgmp_fr_div_ui"
external neg_prec :
prec:int -> mode:Gmp.rounding_mode -> Gmp.FR.t -> Gmp.FR.t
= "_mlgmp_fr_neg"
external abs_prec :
prec:int -> mode:Gmp.rounding_mode -> Gmp.FR.t -> Gmp.FR.t
= "_mlgmp_fr_abs"
external inv_prec :
prec:int -> mode:Gmp.rounding_mode -> Gmp.FR.t -> Gmp.FR.t
= "_mlgmp_fr_div"
external reldiff_prec :
prec:int -> mode:Gmp.rounding_mode -> Gmp.FR.t -> Gmp.FR.t
= "_mlgmp_fr_reldiff"
external ceil_prec : prec:int -> Gmp.FR.t -> Gmp.FR.t
= "_mlgmp_fr_ceil"
external floor_prec : prec:int -> Gmp.FR.t -> Gmp.FR.t
= "_mlgmp_fr_floor"
external trunc_prec : prec:int -> Gmp.FR.t -> Gmp.FR.t
= "_mlgmp_fr_trunc"
external cmp : Gmp.FR.t -> Gmp.FR.t -> int = "_mlgmp_fr_cmp"
external compare : Gmp.FR.t -> Gmp.FR.t -> int = "_mlgmp_fr_cmp"
external sgn : Gmp.FR.t -> int = "_mlgmp_fr_sgn"
external eq : Gmp.FR.t -> Gmp.FR.t -> prec:int -> bool = "_mlgmp_fr_eq"
external is_nan : Gmp.FR.t -> bool = "_mlgmp_fr_is_nan"
external urandomb : prec:int -> state:Gmp.RNG.randstate_t -> Gmp.FR.t
= "_mlgmp_fr_urandomb"
external random : prec:int -> Gmp.FR.t = "_mlgmp_fr_random"
external random2 : prec:int -> nlimbs:int -> max_exp:int -> Gmp.FR.t
= "_mlgmp_fr_random2"
val from_z : Gmp.Z.t -> Gmp.FR.t
val from_q : Gmp.Z.t -> Gmp.FR.t
val from_si : int -> Gmp.FR.t
val from_int : int -> Gmp.FR.t
val from_float : float -> Gmp.FR.t
val to_float : Gmp.FR.t -> float
val from_string_base : base:int -> string -> Gmp.FR.t
val from_string : string -> Gmp.FR.t
val add : Gmp.FR.t -> Gmp.FR.t -> Gmp.FR.t
val sub : Gmp.FR.t -> Gmp.FR.t -> Gmp.FR.t
val mul : Gmp.FR.t -> Gmp.FR.t -> Gmp.FR.t
val div : Gmp.FR.t -> Gmp.FR.t -> Gmp.FR.t
val reldiff : Gmp.FR.t -> Gmp.FR.t
val add_ui : Gmp.FR.t -> int -> Gmp.FR.t
val sub_ui : Gmp.FR.t -> int -> Gmp.FR.t
val mul_ui : Gmp.FR.t -> int -> Gmp.FR.t
val div_ui : Gmp.FR.t -> int -> Gmp.FR.t
val neg : Gmp.FR.t -> Gmp.FR.t
val abs : Gmp.FR.t -> Gmp.FR.t
val inv : Gmp.FR.t -> Gmp.FR.t
val floor : Gmp.FR.t -> Gmp.FR.t
val ceil : Gmp.FR.t -> Gmp.FR.t
val trunc : Gmp.FR.t -> Gmp.FR.t
val equal : Gmp.FR.t -> Gmp.FR.t -> bool
val to_string_base_digits :
mode:Gmp.rounding_mode ->
base:int -> digits:int -> Gmp.FR.t -> string
val to_string : Gmp.FR.t -> string
external to_z_exp : Gmp.FR.t -> Gmp.Z.t * int = "_mlgmp_fr_to_z_exp"
val to_z_t : Gmp.FR.t -> Gmp.Z.t
val to_z_c : Gmp.FR.t -> Gmp.Z.t
val to_z_f : Gmp.FR.t -> Gmp.Z.t
val to_z : Gmp.FR.t -> Gmp.Z.t
val z_from : Gmp.FR.t -> Gmp.Z.t
external is_available : unit -> bool = "_mlgmp_is_mpfr_available"
end
exception Unimplemented of string
external get_gmp_runtime_version : unit -> string
= "_mlgmp_get_runtime_version"
external get_gmp_compile_version : unit -> int * int * int
= "_mlgmp_get_compile_version"
end`