summaryrefslogtreecommitdiff
path: root/tests/tfmod.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2016-02-19 16:29:37 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2016-02-19 16:29:37 +0000
commitfafc839595da9f5ae0efee2cd988fb5ac30c068b (patch)
tree0503bd8b1494b91bbdb28a7c8540897d6c6885dc /tests/tfmod.c
parentfdafd042c335b71fed8d239039cc4925a91f2993 (diff)
downloadmpfr-fafc839595da9f5ae0efee2cd988fb5ac30c068b.tar.gz
[tests/tfmod.c] Added a test that triggers the bug fixed in r10054
without relying on test_generic failure. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@10072 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tfmod.c')
-rw-r--r--tests/tfmod.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/tfmod.c b/tests/tfmod.c
index a40f79beb..682b56f2a 100644
--- a/tests/tfmod.c
+++ b/tests/tfmod.c
@@ -299,6 +299,22 @@ special (void)
if (!mpfr_equal_p (r, x) || inexact != 0)
test_failed (r, x, 0, inexact, x, y, MPFR_RNDN);
+ mpfr_set_zero (x, 1);
+ mpfr_nextabove (x);
+ mpfr_set_inf (y, 1);
+ mpfr_nextbelow (y);
+ inexact = mpfr_fmod (r, x, y, MPFR_RNDN);
+ if (!mpfr_equal_p (r, x) || inexact != 0)
+ {
+ printf ("Error for mpfr_fmod (r, nextabove(0), nextbelow(+inf),"
+ " MPFR_RNDN)\n");
+ printf ("Expected inex = 0, r = ");
+ mpfr_dump (x);
+ printf ("Got inex = %d, r = ", inexact);
+ mpfr_dump (r);
+ exit (1);
+ }
+
mpfr_set_prec (x, 380);
mpfr_set_prec (y, 385);
mpfr_set_str_binary (x, "0.11011010010110011101011000100100101100101011010001011100110001100101111001010100001011111110111100101110101010110011010101000100000100011101101100001011101110100111101111111010001001000010000110010110011100111000001110111010000100101001010111100100010001101001110100011110010000000001110001111001101100111011001000110110011100100011111110010100011001000001001011010111010000000000E0");