diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2021-01-14 11:23:57 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2021-01-14 11:23:57 +0000 |
commit | 1d022f48f413ea8bc99dae4c1169223bf78e7398 (patch) | |
tree | ad7e7c646ae91307c51d52e581b8f7678e45340a /tests | |
parent | 632660dfc7af2c5018d423d5cf7abc1f491dfcba (diff) | |
download | mpfr-1d022f48f413ea8bc99dae4c1169223bf78e7398.tar.gz |
[tests/tcosu.c] Added tests that give a reduced argument equal to 0.
git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14254 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests')
-rw-r--r-- | tests/tcosu.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/tcosu.c b/tests/tcosu.c index d751a2c02..036a0232a 100644 --- a/tests/tcosu.c +++ b/tests/tcosu.c @@ -63,6 +63,18 @@ test_singular (void) MPFR_ASSERTN(mpfr_cmp_ui (y, 1) == 0); MPFR_ASSERTN(inexact == 0); + /* check x/u = 2^16, for example x=3*2^16 and u=3 */ + mpfr_set_ui_2exp (x, 3, 16, MPFR_RNDN); + inexact = mpfr_cosu (y, x, 3, MPFR_RNDN); + MPFR_ASSERTN(mpfr_cmp_ui (y, 1) == 0); + MPFR_ASSERTN(inexact == 0); + + /* check x/u = -2^16, for example x=-3*2^16 and u=3 */ + mpfr_set_si_2exp (x, -3, 16, MPFR_RNDN); + inexact = mpfr_cosu (y, x, 3, MPFR_RNDN); + MPFR_ASSERTN(mpfr_cmp_ui (y, 1) == 0); + MPFR_ASSERTN(inexact == 0); + mpfr_clear (x); mpfr_clear (y); } |