[PATCH] fix excess precision issue in tests/mpf/t-get_d.c
Mikael Pettersson
mikpelinux at gmail.com
Sat Jun 28 22:07:23 CEST 2025
Building gmp-6.2.1, 6.3.0, or current tip, for m68020-linux
results in a failure in the test suite:
make[5]: Entering directory '../tests/mpf'
...
../test-driver: line 112: 18165 Aborted "$@" >> "$log_file" 2>&1
FAIL: t-get_d
This is a regression from gmp-6.1.2 and earlier.
The cause is that a change between 6.1 and 6.2 enabled the code in test_denorms,
and that code is sensitive to excess precision. GMP has a FORCE_DOUBLE macro to
work around such issues, but it's not used here. Using it in a similar way as in
tests/mpn/t-get_d.c fixes the test case.
Tested on m68k-linux-gnu (68040).
Signed-off-by: Mikael Pettersson <mikael.pettersson at acm.org>
---
tests/mpf/t-get_d.c | 1 +
1 file changed, 1 insertion(+)
Note: please use my @acm.org address in any replies.
diff --git a/tests/mpf/t-get_d.c b/tests/mpf/t-get_d.c
index 4e4c741f1..9687cd94e 100644
--- a/tests/mpf/t-get_d.c
+++ b/tests/mpf/t-get_d.c
@@ -60,6 +60,7 @@ test_denorms (int prc)
if (d1 != d2)
abort ();
d1 *= 0.4;
+ FORCE_DOUBLE (d1);
}
mpf_clear (f);
--
2.49.0
More information about the gmp-devel
mailing list