Hi y'all,
I'm doing a clean build of GMP 6.2.1, trying to follow all of the steps
finally. My "./configfsf.guess" output is "x86_64-pc-linux-gnu", and this
is basically the same infothat "./config.guess" and "uname -a" produces.
I built using "./configure" and make, this went fine I think. Then I
While using GMP to read floating point numbers, I noticed that when the
exponent is too large, the exponent overflows without warning or error.
GMP version: gmp-6.2.1-2.fc36.x86_64, installed using dnf on Fedora 36.
Test program: a.c and b.cpp, see attachment.
To run a.c, use "gcc a.c -o a -lgmp
Ciao,
Il 2022-09-05 21:23 ni...@lysator.liu.se ha scritto:
Marco Bodrato writes:
I propose to also add a couple of tests to mini-gmp/tests/t-powm.c ,
to keep track of this.
Definitely needed, thanks for looking into that.
+ if (mpz_cmp_ui (res, 1) <= 0)
+mpz_add_ui (res, res, 9);
Marco Bodrato writes:
>>> 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?
Committed, and I've verified that it fixes Guido's test case.
> I propose to also add a couple of tests
Ciao,
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?
Concerning this second solution, the GMP manual says:
-- Function: int
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