sig
type t
exception Overflow
val zero : Z.t
val one : Z.t
val minus_one : Z.t
external of_int : int -> Z.t = "ml_z_of_int" "noalloc"
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"
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"
external succ : Z.t -> Z.t = "ml_z_succ" "ml_as_z_succ"
external pred : Z.t -> Z.t = "ml_z_pred" "ml_as_z_pred"
external abs : Z.t -> Z.t = "ml_z_abs" "ml_as_z_abs"
external neg : Z.t -> Z.t = "ml_z_neg" "ml_as_z_neg"
external add : Z.t -> Z.t -> Z.t = "ml_z_add" "ml_as_z_add"
external sub : Z.t -> Z.t -> Z.t = "ml_z_sub" "ml_as_z_sub"
external mul : Z.t -> Z.t -> Z.t = "ml_z_mul" "ml_as_z_mul"
external div : Z.t -> Z.t -> Z.t = "ml_z_div" "ml_as_z_div"
external rem : Z.t -> Z.t -> Z.t = "ml_z_rem" "ml_as_z_rem"
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
external divexact : Z.t -> Z.t -> Z.t = "ml_z_divexact" "ml_as_z_divexact"
external logand : Z.t -> Z.t -> Z.t = "ml_z_logand" "ml_as_z_logand"
external logor : Z.t -> Z.t -> Z.t = "ml_z_logor" "ml_as_z_logor"
external logxor : Z.t -> Z.t -> Z.t = "ml_z_logxor" "ml_as_z_logxor"
external lognot : Z.t -> Z.t = "ml_z_lognot" "ml_as_z_lognot"
external shift_left : Z.t -> int -> Z.t = "ml_z_shift_left"
"ml_as_z_shift_left"
external shift_right : Z.t -> int -> Z.t = "ml_z_shift_right"
"ml_as_z_shift_right"
external shift_right_trunc : Z.t -> int -> Z.t = "ml_z_shift_right_trunc"
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"
external to_int : Z.t -> int = "ml_z_to_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"
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"
val print : Z.t -> unit
val output : Pervasives.out_channel -> Z.t -> unit
val sprint : unit -> Z.t -> string
val bprint : Buffer.t -> Z.t -> unit
val pp_print : 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
external hash : Z.t -> int = "ml_z_hash" "noalloc"
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 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 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"
external extract : Z.t -> int -> int -> Z.t = "ml_z_extract"
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"
external ( ~- ) : Z.t -> Z.t = "ml_z_neg" "ml_as_z_neg"
val ( ~+ ) : Z.t -> Z.t
external ( + ) : Z.t -> Z.t -> Z.t = "ml_z_add" "ml_as_z_add"
external ( - ) : Z.t -> Z.t -> Z.t = "ml_z_sub" "ml_as_z_sub"
external ( * ) : Z.t -> Z.t -> Z.t = "ml_z_mul" "ml_as_z_mul"
external ( / ) : Z.t -> Z.t -> Z.t = "ml_z_div" "ml_as_z_div"
external ( /> ) : Z.t -> Z.t -> Z.t = "ml_z_cdiv"
external ( /< ) : Z.t -> Z.t -> Z.t = "ml_z_fdiv"
external ( /| ) : Z.t -> Z.t -> Z.t = "ml_z_divexact" "ml_as_z_divexact"
external ( mod ) : Z.t -> Z.t -> Z.t = "ml_z_rem" "ml_as_z_rem"
external ( land ) : Z.t -> Z.t -> Z.t = "ml_z_logand" "ml_as_z_logand"
external ( lor ) : Z.t -> Z.t -> Z.t = "ml_z_logor" "ml_as_z_logor"
external ( lxor ) : Z.t -> Z.t -> Z.t = "ml_z_logxor" "ml_as_z_logxor"
external ( ~! ) : Z.t -> Z.t = "ml_z_lognot" "ml_as_z_lognot"
external ( lsl ) : Z.t -> int -> Z.t = "ml_z_shift_left"
"ml_as_z_shift_left"
external ( asr ) : Z.t -> int -> Z.t = "ml_z_shift_right"
"ml_as_z_shift_right"
external ( ~$ ) : int -> Z.t = "ml_z_of_int" "noalloc"
external ( ** ) : Z.t -> int -> Z.t = "ml_z_pow"
val version : string
end