C implementation of mod_1_1

Niels Möller nisse at lysator.liu.se
Tue Mar 1 13:23:00 CET 2011

Torbjorn Granlund <tg at gmplib.org> writes:

> It seems my patches did *not* fix the mips longlong problem.

I'm trying to understand what's going on there. It looks like mpq_get_d
fails. This function seems to call mpn_tdiv_qr and mpn_get_d. The latter
seems to do some bitfiddling unrelated to division changes.

The call to mpn_tdiv_qr seems pass qxn == 0 (fraction size), and instead
there is padding to get fraction limbs if needed. Most of the divisions
should be udiv_qr_3by2, not udiv_qrnnd_preinv.

Could also be an error in the computations before mpq_get_d. I suspect
the difference in exponent between "last" and "new" is unexpected (one
could examine the printouts to see if its mpq_get_d gave a sensible
result or not, I think, but I can't do that at the moment).

Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26.
Internet email is subject to wholesale government surveillance.

More information about the gmp-devel mailing list