`sig
type t
external canonicalize : Mpq.t -> unit = "camlidl_mpq_mpq_canonicalize"
val print : Stdlib.Format.formatter -> Mpq.t -> unit
external init : unit -> Mpq.t = "camlidl_mpq_mpq_init"
external set : Mpq.t -> Mpq.t -> unit = "camlidl_mpq_mpq_set"
external set_z : Mpq.t -> Mpz.t -> unit = "camlidl_mpq_mpq_set_z"
external set_si : Mpq.t -> int -> int -> unit = "camlidl_mpq_mpq_set_si"
external _set_str : Mpq.t -> string -> int -> unit
= "camlidl_mpq_mpq__set_str"
val set_str : Mpq.t -> string -> base:int -> unit
external swap : Mpq.t -> Mpq.t -> unit = "camlidl_mpq_mpq_swap"
val init_set : Mpq.t -> Mpq.t
val init_set_z : Mpz.t -> Mpq.t
val init_set_si : int -> int -> Mpq.t
val init_set_str : string -> base:int -> Mpq.t
val init_set_d : float -> Mpq.t
external get_d : Mpq.t -> float = "camlidl_mpq_mpq_get_d"
external set_d : Mpq.t -> float -> unit = "camlidl_mpq_mpq_set_d"
external get_z : Mpz.t -> Mpq.t -> unit = "camlidl_mpq_mpq_get_z"
external _get_str : int -> Mpq.t -> string = "camlidl_mpq_mpq__get_str"
val get_str : base:int -> Mpq.t -> string
val to_string : Mpq.t -> string
val to_float : Mpq.t -> float
val of_string : string -> Mpq.t
val of_float : float -> Mpq.t
val of_int : int -> Mpq.t
val of_frac : int -> int -> Mpq.t
val of_mpz : Mpz.t -> Mpq.t
val of_mpz2 : Mpz.t -> Mpz.t -> Mpq.t
external add : Mpq.t -> Mpq.t -> Mpq.t -> unit = "camlidl_mpq_mpq_add"
external sub : Mpq.t -> Mpq.t -> Mpq.t -> unit = "camlidl_mpq_mpq_sub"
external mul : Mpq.t -> Mpq.t -> Mpq.t -> unit = "camlidl_mpq_mpq_mul"
external mul_2exp : Mpq.t -> Mpq.t -> int -> unit
= "camlidl_mpq_mpq_mul_2exp"
external div : Mpq.t -> Mpq.t -> Mpq.t -> unit = "camlidl_mpq_mpq_div"
external div_2exp : Mpq.t -> Mpq.t -> int -> unit
= "camlidl_mpq_mpq_div_2exp"
external neg : Mpq.t -> Mpq.t -> unit = "camlidl_mpq_mpq_neg"
external abs : Mpq.t -> Mpq.t -> unit = "camlidl_mpq_mpq_abs"
external inv : Mpq.t -> Mpq.t -> unit = "camlidl_mpq_mpq_inv"
external cmp : Mpq.t -> Mpq.t -> int = "camlidl_mpq_mpq_cmp"
external cmp_si : Mpq.t -> int -> int -> int = "camlidl_mpq_mpq_cmp_si"
external sgn : Mpq.t -> int = "camlidl_mpq_mpq_sgn"
external equal : Mpq.t -> Mpq.t -> bool = "camlidl_mpq_mpq_equal"
external get_num : Mpz.t -> Mpq.t -> unit = "camlidl_mpq_mpq_get_num"
external get_den : Mpz.t -> Mpq.t -> unit = "camlidl_mpq_mpq_get_den"
external set_num : Mpq.t -> Mpz.t -> unit = "camlidl_mpq_mpq_set_num"
external set_den : Mpq.t -> Mpz.t -> unit = "camlidl_mpq_mpq_set_den"
end`