mini-gmp mpz_powm incorrect result

Marco Bodrato bodrato at
Mon Sep 5 19:17:11 CEST 2022

Il 2022-09-05 19:04 Marco Bodrato ha scritto:
> Il 2022-08-30 10:25 Vincent Lefevre ha scritto:
>>> or even (mn == 0 check just above this code rules out |m| < 1)
>>>    mpz_set_ui (r, mpz_cmpabs_ui (m, 1));
> I agree with this solution. Will you commit it?

I incorrectly removed the "Niels Möller wrote:" line.
The question is for Niels, of course.

> I propose to also add a couple of tests to mini-gmp/tests/t-powm.c ,
> to keep track of this.

I'll push the tests just after the correction...


PS: thanks for the report

More information about the gmp-bugs mailing list