Re: GMP does not detect float exponent overflow while reading floating point numbers

2022-09-30 Thread Vincent Lefevre
On 2022-09-16 16:34:58 -0400, Eric Li wrote: > Thanks to https://stackoverflow.com/a/73740744, looks like the cause of > the bug it that GMP triggered a signed overflow in the following code > (from https://gmplib.org/repo/gmp/file/feb796a7f683/mpf/set_str.c#l315) [...] I've given an answer:

Re: GMP does not detect float exponent overflow while reading floating point numbers

2022-09-30 Thread Paul Zimmermann
Hi Eric, > 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 && ./a". The output on my machine > is "0.1e-3215911262793760767". > To run b.cpp, use "g++ b.cpp -o b -lgmp -lgmpxx &&

GMP does not detect float exponent overflow while reading floating point numbers

2022-09-29 Thread Eric Li
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