summaryrefslogtreecommitdiff
path: root/tests/tsin.c
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2001-12-21 16:33:10 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2001-12-21 16:33:10 +0000
commit36cf516e629da8c294bc7359916a7eb263e9989c (patch)
treed2ee647836a72185eda5ad74ba28d883676c4e3b /tests/tsin.c
parent5211a8d7c7b9c77675e44d350f24c95da5b8c04b (diff)
downloadmpfr-36cf516e629da8c294bc7359916a7eb263e9989c.tar.gz
added check for sin(3*Pi/2)
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@1640 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tsin.c')
-rw-r--r--tests/tsin.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/tsin.c b/tests/tsin.c
index e2c7eb897..b302b025c 100644
--- a/tests/tsin.c
+++ b/tests/tsin.c
@@ -70,6 +70,7 @@ main (int argc, char *argv[])
check53 (1.00591265847407274059, 8.446508805292128885e-1, GMP_RNDN);
mpfr_init2 (x, 2);
+
mpfr_set_d (x, 0.5, GMP_RNDN);
mpfr_sin (x, x, GMP_RNDD);
if (mpfr_get_d(x) != 0.375)
@@ -77,6 +78,18 @@ main (int argc, char *argv[])
fprintf (stderr, "mpfr_sin(0.5, GMP_RNDD) failed with precision=2\n");
exit (1);
}
+
+ /* bug found by Kevin Ryde */
+ mpfr_const_pi (x, GMP_RNDN);
+ mpfr_mul_ui (x, x, 3L, GMP_RNDN);
+ mpfr_div_ui (x, x, 2L, GMP_RNDN);
+ mpfr_sin (x, x, GMP_RNDN);
+ if (mpfr_cmp_ui (x, 0) >= 0)
+ {
+ fprintf (stderr, "Error: wrong sign for sin(3*Pi/2)\n");
+ exit (1);
+ }
+
mpfr_clear (x);
test_generic (2, 100, 80);