let to_string q = let d = Q.get_den q in if Gmp41.Z.cmp_si d 1 == 0 then Gmp41.Z.string_from (Q.get_num q) else (Gmp41.Z.string_from (Q.get_num q)) ^ "/" ^ (Gmp41.Z.string_from d)