Álvaro Begué <alvaro.be...@gmail.com> writes: mpz_class fraction_mod_m(mpq_class x, mpz_class m) { mpz_t inverse; mpz_class den = x.get_den(); mpz_invert(inverse, den.get_mpz_t(), m.get_mpz_t()); // Crashes return mpz_class(inverse); } No GMP bug.
Please re-read https://gmplib.org/manual/GMP-Basics.html, in particular https://gmplib.org/manual/Variable-Conventions.html in order to use GMP in C-style correctly. Why do you mix C++ style and C style? -- Torbjörn Please encrypt, key id 0xC8601622 _______________________________________________ gmp-bugs mailing list gmp-bugs@gmplib.org https://gmplib.org/mailman/listinfo/gmp-bugs