sig
type t = Gmp41.Z2.t
external of_int : int -> Gmp41.Z.t = "_mlgmp_z_from_int"
external from_int : int -> Gmp41.Z.t = "_mlgmp_z_from_int"
external from_string_base : base:int -> string -> Gmp41.Z.t
= "_mlgmp_z_from_string_base"
external of_float : int -> Gmp41.Z.t = "_mlgmp_z_from_float"
external from_float : float -> Gmp41.Z.t = "_mlgmp_z_from_float"
external to_string_base : base:int -> Gmp41.Z.t -> string
= "_mlgmp_z_to_string_base"
external to_int : Gmp41.Z.t -> int = "_mlgmp_z_to_int"
external to_float : Gmp41.Z.t -> float = "_mlgmp_z_to_float"
external int_from : Gmp41.Z.t -> int = "_mlgmp_z_to_int"
external float_from : Gmp41.Z.t -> float = "_mlgmp_z_to_float"
external add : Gmp41.Z.t -> Gmp41.Z.t -> Gmp41.Z.t = "_mlgmp_z_add"
external sub : Gmp41.Z.t -> Gmp41.Z.t -> Gmp41.Z.t = "_mlgmp_z_sub"
external mul : Gmp41.Z.t -> Gmp41.Z.t -> Gmp41.Z.t = "_mlgmp_z_mul"
external add_ui : Gmp41.Z.t -> int -> Gmp41.Z.t = "_mlgmp_z_add_ui"
external sub_ui : Gmp41.Z.t -> int -> Gmp41.Z.t = "_mlgmp_z_sub_ui"
external mul_ui : Gmp41.Z.t -> int -> Gmp41.Z.t = "_mlgmp_z_mul_ui"
external neg : Gmp41.Z.t -> Gmp41.Z.t = "_mlgmp_z_neg"
external abs : Gmp41.Z.t -> Gmp41.Z.t = "_mlgmp_z_abs"
external tdiv_qr : Gmp41.Z.t -> Gmp41.Z.t -> Gmp41.Z.t * Gmp41.Z.t
= "_mlgmp_z_tdiv_qr"
external tdiv_q : Gmp41.Z.t -> Gmp41.Z.t -> Gmp41.Z.t = "_mlgmp_z_tdiv_q"
external tdiv_r : Gmp41.Z.t -> Gmp41.Z.t -> Gmp41.Z.t = "_mlgmp_z_tdiv_r"
external cdiv_qr : Gmp41.Z.t -> Gmp41.Z.t -> Gmp41.Z.t * Gmp41.Z.t
= "_mlgmp_z_cdiv_qr"
external cdiv_q : Gmp41.Z.t -> Gmp41.Z.t -> Gmp41.Z.t = "_mlgmp_z_cdiv_q"
external cdiv_r : Gmp41.Z.t -> Gmp41.Z.t -> Gmp41.Z.t = "_mlgmp_z_cdiv_r"
external fdiv_qr : Gmp41.Z.t -> Gmp41.Z.t -> Gmp41.Z.t * Gmp41.Z.t
= "_mlgmp_z_fdiv_qr"
external fdiv_q : Gmp41.Z.t -> Gmp41.Z.t -> Gmp41.Z.t = "_mlgmp_z_fdiv_q"
external fdiv_r : Gmp41.Z.t -> Gmp41.Z.t -> Gmp41.Z.t = "_mlgmp_z_fdiv_r"
external dmod : Gmp41.Z.t -> Gmp41.Z.t -> Gmp41.Z.t = "_mlgmp_z_mod"
external dmod_ui : Gmp41.Z.t -> int -> Gmp41.Z.t = "_mlgmp_z_mod_ui"
external euclidean_division :
Gmp41.Z.t -> Gmp41.Z.t -> Gmp41.Z.t * Gmp41.Z.t = "_mlgmp_z_fdiv_qr"
external modulo : Gmp41.Z.t -> Gmp41.Z.t -> Gmp41.Z.t = "_mlgmp_z_mod"
external tdiv_qr_ui : Gmp41.Z.t -> int -> Gmp41.Z.t * Gmp41.Z.t
= "_mlgmp_z_tdiv_qr_ui"
external tdiv_q_ui : Gmp41.Z.t -> int -> Gmp41.Z.t = "_mlgmp_z_tdiv_q_ui"
external tdiv_r_ui : Gmp41.Z.t -> int -> Gmp41.Z.t = "_mlgmp_z_tdiv_r_ui"
external tdiv_ui : Gmp41.Z.t -> int -> int = "_mlgmp_z_tdiv_ui"
external cdiv_qr_ui : Gmp41.Z.t -> int -> Gmp41.Z.t * Gmp41.Z.t
= "_mlgmp_z_cdiv_qr_ui"
external cdiv_q_ui : Gmp41.Z.t -> int -> Gmp41.Z.t = "_mlgmp_z_cdiv_q_ui"
external cdiv_r_ui : Gmp41.Z.t -> int -> Gmp41.Z.t = "_mlgmp_z_cdiv_r_ui"
external cdiv_ui : Gmp41.Z.t -> int -> int = "_mlgmp_z_cdiv_ui"
external fdiv_qr_ui : Gmp41.Z.t -> int -> Gmp41.Z.t * Gmp41.Z.t
= "_mlgmp_z_fdiv_qr_ui"
external fdiv_q_ui : Gmp41.Z.t -> int -> Gmp41.Z.t = "_mlgmp_z_fdiv_q_ui"
external fdiv_r_ui : Gmp41.Z.t -> int -> Gmp41.Z.t = "_mlgmp_z_fdiv_r_ui"
external fdiv_ui : Gmp41.Z.t -> int -> int = "_mlgmp_z_fdiv_ui"
external divexact : Gmp41.Z.t -> Gmp41.Z.t -> Gmp41.Z.t
= "_mlgmp_z_divexact"
external mul_2exp : Gmp41.Z.t -> int -> Gmp41.Z.t = "_mlgmp_z_mul_2exp"
external mul2exp : Gmp41.Z.t -> int -> Gmp41.Z.t = "_mlgmp_z_mul_2exp"
external tdiv_q_2exp : Gmp41.Z.t -> int -> Gmp41.Z.t
= "_mlgmp_z_tdiv_q_2exp"
external tdiv_r_2exp : Gmp41.Z.t -> int -> Gmp41.Z.t
= "_mlgmp_z_tdiv_r_2exp"
external fdiv_q_2exp : Gmp41.Z.t -> int -> Gmp41.Z.t
= "_mlgmp_z_fdiv_q_2exp"
external fdiv_r_2exp : Gmp41.Z.t -> int -> Gmp41.Z.t
= "_mlgmp_z_fdiv_r_2exp"
external cdiv_q_2exp : Gmp41.Z.t -> int -> Gmp41.Z.t
= "_mlgmp_z_cdiv_q_2exp"
external cdiv_r_2exp : Gmp41.Z.t -> int -> Gmp41.Z.t
= "_mlgmp_z_cdiv_r_2exp"
external powm : Gmp41.Z.t -> Gmp41.Z.t -> Gmp41.Z.t -> Gmp41.Z.t
= "_mlgmp_z_powm"
external powm_ui : Gmp41.Z.t -> int -> Gmp41.Z.t -> Gmp41.Z.t
= "_mlgmp_z_powm_ui"
external pow_ui : Gmp41.Z.t -> int -> Gmp41.Z.t = "_mlgmp_z_pow_ui"
external ui_pow_ui : int -> int -> Gmp41.Z.t = "_mlgmp_z_ui_pow_ui"
external pow_ui_ui : int -> int -> Gmp41.Z.t = "_mlgmp_z_ui_pow_ui"
external sqrt : Gmp41.Z.t -> Gmp41.Z.t = "_mlgmp_z_sqrt"
external sqrtrem : Gmp41.Z.t -> Gmp41.Z.t * Gmp41.Z.t = "_mlgmp_z_sqrtrem"
external root : Gmp41.Z.t -> int -> Gmp41.Z.t = "_mlgmp_z_root"
external perfect_power_p : Gmp41.Z.t -> bool = "_mlgmp_z_perfect_power_p"
external perfect_square_p : Gmp41.Z.t -> bool = "_mlgmp_z_perfect_square_p"
external is_perfect_power : Gmp41.Z.t -> bool = "_mlgmp_z_perfect_power_p"
external is_perfect_square : Gmp41.Z.t -> bool
= "_mlgmp_z_perfect_square_p"
external probab_prime_p : Gmp41.Z.t -> int -> bool
= "_mlgmp_z_probab_prime_p"
external is_probab_prime : Gmp41.Z.t -> int -> bool
= "_mlgmp_z_probab_prime_p"
external nextprime : Gmp41.Z.t -> Gmp41.Z.t = "_mlgmp_z_nextprime"
external gcd : Gmp41.Z.t -> Gmp41.Z.t -> Gmp41.Z.t = "_mlgmp_z_gcd"
external gcd_ui : Gmp41.Z.t -> Gmp41.Z.t -> Gmp41.Z.t = "_mlgmp_z_gcd_ui"
external lcm : Gmp41.Z.t -> Gmp41.Z.t -> Gmp41.Z.t = "_mlgmp_z_lcm"
external gcdext :
Gmp41.Z.t -> Gmp41.Z.t -> Gmp41.Z.t * Gmp41.Z.t * Gmp41.Z.t
= "_mlgmp_z_gcdext"
external inverse : Gmp41.Z.t -> Gmp41.Z.t -> Gmp41.Z.t option
= "_mlgmp_z_invert"
external legendre : Gmp41.Z.t -> int = "_mlgmp_z_legendre"
external jacobi : Gmp41.Z.t -> int = "_mlgmp_z_jacobi"
external kronecker_si : Gmp41.Z.t -> int -> int = "_mlgmp_z_kronecker_si"
external si_kronecker : int -> Gmp41.Z.t -> int = "_mlgmp_z_si_kronecker"
external remove : Gmp41.Z.t -> Gmp41.Z.t -> Gmp41.Z.t * int
= "_mlgmp_z_remove"
external fac_ui : int -> Gmp41.Z.t = "_mlgmp_z_fac_ui"
external fib_ui : int -> Gmp41.Z.t = "_mlgmp_z_fib_ui"
external bin_ui : n:Gmp41.Z.t -> k:int -> Gmp41.Z.t = "_mlgmp_z_bin_ui"
external bin_uiui : n:int -> k:int -> Gmp41.Z.t = "_mlgmp_z_bin_uiui"
external cmp : Gmp41.Z.t -> Gmp41.Z.t -> int = "_mlgmp_z_compare"
external cmp_si : Gmp41.Z.t -> int -> int = "_mlgmp_z_compare_si"
external compare : Gmp41.Z.t -> Gmp41.Z.t -> int = "_mlgmp_z_compare"
external compare_si : Gmp41.Z.t -> int -> int = "_mlgmp_z_compare_si"
external compare_int : Gmp41.Z.t -> int -> int = "_mlgmp_z_compare_si"
external sgn : Gmp41.Z.t -> int = "_mlgmp_z_sgn"
external band : Gmp41.Z.t -> Gmp41.Z.t -> Gmp41.Z.t = "_mlgmp_z_and"
external bior : Gmp41.Z.t -> Gmp41.Z.t -> Gmp41.Z.t = "_mlgmp_z_ior"
external bxor : Gmp41.Z.t -> Gmp41.Z.t -> Gmp41.Z.t = "_mlgmp_z_xor"
external bcom : Gmp41.Z.t -> Gmp41.Z.t = "_mlgmp_z_com"
external popcount : Gmp41.Z.t -> int = "_mlgmp_z_popcount"
external hamdist : Gmp41.Z.t -> Gmp41.Z.t -> int = "_mlgmp_z_hamdist"
external scan0 : Gmp41.Z.t -> int -> int = "_mlgmp_z_scan0"
external scan1 : Gmp41.Z.t -> int -> int = "_mlgmp_z_scan1"
external urandomb : state:Gmp41.RNG.randstate_t -> nbits:int -> Gmp41.Z.t
= "_mlgmp_z_urandomb"
external urandomm : state:Gmp41.RNG.randstate_t -> n:Gmp41.Z.t -> Gmp41.Z.t
= "_mlgmp_z_urandomm"
external rrandomb : state:Gmp41.RNG.randstate_t -> nbits:int -> Gmp41.Z.t
= "_mlgmp_z_rrandomb"
val zero : Gmp41.Z.t
val one : Gmp41.Z.t
val succ : Gmp41.Z.t -> Gmp41.Z.t
val pred : Gmp41.Z.t -> Gmp41.Z.t
val min : Gmp41.Z.t -> Gmp41.Z.t -> Gmp41.Z.t
val max : Gmp41.Z.t -> Gmp41.Z.t -> Gmp41.Z.t
val is_prime : ?prec:int -> Gmp41.Z.t -> bool
val equal : Gmp41.Z.t -> Gmp41.Z.t -> bool
val equal_int : Gmp41.Z.t -> int -> bool
val is_zero : Gmp41.Z.t -> bool
val to_string : Gmp41.Z.t -> string
val from_string : string -> Gmp41.Z.t
val string_from : Gmp41.Z.t -> string
val output : Pervasives.out_channel -> Gmp41.Z.t -> unit
val sprintf : unit -> Gmp41.Z.t -> string
val print : Format.formatter -> Gmp41.Z.t -> unit
module Infixes :
sig
external ( +! ) : Gmp41.Z.t -> Gmp41.Z.t -> Gmp41.Z.t = "_mlgmp_z_add"
external ( -! ) : Gmp41.Z.t -> Gmp41.Z.t -> Gmp41.Z.t = "_mlgmp_z_sub"
external ( *! ) : Gmp41.Z.t -> Gmp41.Z.t -> Gmp41.Z.t = "_mlgmp_z_mul"
external ( /! ) : Gmp41.Z.t -> Gmp41.Z.t -> Gmp41.Z.t
= "_mlgmp_z_fdiv_q"
external ( %! ) : Gmp41.Z.t -> Gmp41.Z.t -> Gmp41.Z.t
= "_mlgmp_z_fdiv_r"
val ( <! ) : Gmp41.Z.t -> Gmp41.Z.t -> bool
val ( <=! ) : Gmp41.Z.t -> Gmp41.Z.t -> bool
val ( =! ) : Gmp41.Z.t -> Gmp41.Z.t -> bool
val ( >=! ) : Gmp41.Z.t -> Gmp41.Z.t -> bool
val ( >! ) : Gmp41.Z.t -> Gmp41.Z.t -> bool
val ( <>! ) : Gmp41.Z.t -> Gmp41.Z.t -> bool
end
end