speed of mpq_cmp vs mpq_sub

paul zimmermann Paul.Zimmermann at inria.fr
Sun May 22 10:26:30 UTC 2016


maybe mpq_cmp could first check if the denominators are equal, and in that
case call mpz_cmp on the numerators, and in the other case do the expensive
test I guess it is doing currently, i.e., a/b < c/d iff a*d < b*c. I guess
some fast pre-test is done to check whether a*d and b*c could be in the same


PS: note one could also check a=c first, but that should occur less frequently.

More information about the gmp-discuss mailing list