`sig
type t
exception Overflow
val zero : Z.t
val one : Z.t
val minus_one : Z.t
external of_int : int -> Z.t = "%identity"
external of_int32 : int32 -> Z.t = "ml_z_of_int32"
external of_int64 : int64 -> Z.t = "ml_z_of_int64"
external of_nativeint : nativeint -> Z.t = "ml_z_of_nativeint"
val of_int32_unsigned : int32 -> Z.t
val of_int64_unsigned : int64 -> Z.t
val of_nativeint_unsigned : nativeint -> Z.t
external of_float : float -> Z.t = "ml_z_of_float"
val of_string : string -> Z.t
val of_substring : string -> pos:int -> len:int -> Z.t
val of_string_base : int -> string -> Z.t
external of_substring_base : int -> string -> pos:int -> len:int -> Z.t
= "ml_z_of_substring_base"
val succ : Z.t -> Z.t
val pred : Z.t -> Z.t
val abs : Z.t -> Z.t
val neg : Z.t -> Z.t
val add : Z.t -> Z.t -> Z.t
val sub : Z.t -> Z.t -> Z.t
val mul : Z.t -> Z.t -> Z.t
val div : Z.t -> Z.t -> Z.t
val rem : Z.t -> Z.t -> Z.t
external div_rem : Z.t -> Z.t -> Z.t * Z.t = "ml_z_div_rem"
external cdiv : Z.t -> Z.t -> Z.t = "ml_z_cdiv"
external fdiv : Z.t -> Z.t -> Z.t = "ml_z_fdiv"
val ediv_rem : Z.t -> Z.t -> Z.t * Z.t
val ediv : Z.t -> Z.t -> Z.t
val erem : Z.t -> Z.t -> Z.t
val divexact : Z.t -> Z.t -> Z.t
val divisible : Z.t -> Z.t -> bool
external congruent : Z.t -> Z.t -> Z.t -> bool = "ml_z_congruent"
val logand : Z.t -> Z.t -> Z.t
val logor : Z.t -> Z.t -> Z.t
val logxor : Z.t -> Z.t -> Z.t
val lognot : Z.t -> Z.t
val shift_left : Z.t -> int -> Z.t
val shift_right : Z.t -> int -> Z.t
val shift_right_trunc : Z.t -> int -> Z.t
external numbits : Z.t -> int = "ml_z_numbits" [@@noalloc]
external trailing_zeros : Z.t -> int = "ml_z_trailing_zeros" [@@noalloc]
val testbit : Z.t -> int -> bool
external popcount : Z.t -> int = "ml_z_popcount"
external hamdist : Z.t -> Z.t -> int = "ml_z_hamdist"
val to_int : Z.t -> int
external to_int32 : Z.t -> int32 = "ml_z_to_int32"
external to_int64 : Z.t -> int64 = "ml_z_to_int64"
external to_nativeint : Z.t -> nativeint = "ml_z_to_nativeint"
external to_int32_unsigned : Z.t -> int32 = "ml_z_to_int32_unsigned"
external to_int64_unsigned : Z.t -> int64 = "ml_z_to_int64_unsigned"
external to_nativeint_unsigned : Z.t -> nativeint
= "ml_z_to_nativeint_unsigned"
val to_float : Z.t -> float
val to_string : Z.t -> string
external format : string -> Z.t -> string = "ml_z_format"
external fits_int : Z.t -> bool = "ml_z_fits_int" [@@noalloc]
external fits_int32 : Z.t -> bool = "ml_z_fits_int32" [@@noalloc]
external fits_int64 : Z.t -> bool = "ml_z_fits_int64" [@@noalloc]
external fits_nativeint : Z.t -> bool = "ml_z_fits_nativeint" [@@noalloc]
external fits_int32_unsigned : Z.t -> bool = "ml_z_fits_int32_unsigned"
[@@noalloc]
external fits_int64_unsigned : Z.t -> bool = "ml_z_fits_int64_unsigned"
[@@noalloc]
external fits_nativeint_unsigned : Z.t -> bool
= "ml_z_fits_nativeint_unsigned" [@@noalloc]
val print : Z.t -> unit
val output : Stdlib.out_channel -> Z.t -> unit
val sprint : unit -> Z.t -> string
val bprint : Stdlib.Buffer.t -> Z.t -> unit
val pp_print : Stdlib.Format.formatter -> Z.t -> unit
external compare : Z.t -> Z.t -> int = "ml_z_compare" [@@noalloc]
external equal : Z.t -> Z.t -> bool = "ml_z_equal" [@@noalloc]
val leq : Z.t -> Z.t -> bool
val geq : Z.t -> Z.t -> bool
val lt : Z.t -> Z.t -> bool
val gt : Z.t -> Z.t -> bool
external sign : Z.t -> int = "ml_z_sign" [@@noalloc]
val min : Z.t -> Z.t -> Z.t
val max : Z.t -> Z.t -> Z.t
val is_even : Z.t -> bool
val is_odd : Z.t -> bool
val hash : Z.t -> int
val seeded_hash : int -> Z.t -> int
external gcd : Z.t -> Z.t -> Z.t = "ml_z_gcd"
val gcdext : Z.t -> Z.t -> Z.t * Z.t * Z.t
val lcm : Z.t -> Z.t -> Z.t
external powm : Z.t -> Z.t -> Z.t -> Z.t = "ml_z_powm"
external powm_sec : Z.t -> Z.t -> Z.t -> Z.t = "ml_z_powm_sec"
external invert : Z.t -> Z.t -> Z.t = "ml_z_invert"
external probab_prime : Z.t -> int -> int = "ml_z_probab_prime"
external nextprime : Z.t -> Z.t = "ml_z_nextprime"
external jacobi : Z.t -> Z.t -> int = "ml_z_jacobi"
external legendre : Z.t -> Z.t -> int = "ml_z_legendre"
external kronecker : Z.t -> Z.t -> int = "ml_z_kronecker"
external remove : Z.t -> Z.t -> Z.t * int = "ml_z_remove"
external fac : int -> Z.t = "ml_z_fac"
external fac2 : int -> Z.t = "ml_z_fac2"
external facM : int -> int -> Z.t = "ml_z_facM"
external primorial : int -> Z.t = "ml_z_primorial"
external bin : Z.t -> int -> Z.t = "ml_z_bin"
external fib : int -> Z.t = "ml_z_fib"
external lucnum : int -> Z.t = "ml_z_lucnum"
external pow : Z.t -> int -> Z.t = "ml_z_pow"
external sqrt : Z.t -> Z.t = "ml_z_sqrt"
external sqrt_rem : Z.t -> Z.t * Z.t = "ml_z_sqrt_rem"
external root : Z.t -> int -> Z.t = "ml_z_root"
external rootrem : Z.t -> int -> Z.t * Z.t = "ml_z_rootrem"
external perfect_power : Z.t -> bool = "ml_z_perfect_power"
external perfect_square : Z.t -> bool = "ml_z_perfect_square"
val log2 : Z.t -> int
val log2up : Z.t -> int
external size : Z.t -> int = "ml_z_size" [@@noalloc]
val extract : Z.t -> int -> int -> Z.t
val signed_extract : Z.t -> int -> int -> Z.t
external to_bits : Z.t -> string = "ml_z_to_bits"
external of_bits : string -> Z.t = "ml_z_of_bits"
val random_int : ?rng:Stdlib.Random.State.t -> Z.t -> Z.t
val random_bits : ?rng:Stdlib.Random.State.t -> int -> Z.t
val random_int_gen : fill:(bytes -> int -> int -> unit) -> Z.t -> Z.t
val random_bits_gen : fill:(bytes -> int -> int -> unit) -> int -> Z.t
val ( ~- ) : Z.t -> Z.t
val ( ~+ ) : Z.t -> Z.t
val ( + ) : Z.t -> Z.t -> Z.t
val ( - ) : Z.t -> Z.t -> Z.t
val ( * ) : Z.t -> Z.t -> Z.t
val ( / ) : Z.t -> Z.t -> Z.t
external ( /> ) : Z.t -> Z.t -> Z.t = "ml_z_cdiv"
external ( /< ) : Z.t -> Z.t -> Z.t = "ml_z_fdiv"
val ( /| ) : Z.t -> Z.t -> Z.t
val ( mod ) : Z.t -> Z.t -> Z.t
val ( land ) : Z.t -> Z.t -> Z.t
val ( lor ) : Z.t -> Z.t -> Z.t
val ( lxor ) : Z.t -> Z.t -> Z.t
val ( ~! ) : Z.t -> Z.t
val ( lsl ) : Z.t -> int -> Z.t
val ( asr ) : Z.t -> int -> Z.t
external ( ~$ ) : int -> Z.t = "%identity"
external ( ** ) : Z.t -> int -> Z.t = "ml_z_pow"
module Compare :
sig
val ( = ) : Z.t -> Z.t -> bool
val ( < ) : Z.t -> Z.t -> bool
val ( > ) : Z.t -> Z.t -> bool
val ( <= ) : Z.t -> Z.t -> bool
val ( >= ) : Z.t -> Z.t -> bool
val ( <> ) : Z.t -> Z.t -> bool
end
val version : string
val round_to_float : Z.t -> bool -> float
end`