summaryrefslogtreecommitdiff
path: root/tests/thypot.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2005-05-17 15:14:37 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2005-05-17 15:14:37 +0000
commit10eecffeaa739ebe453ec87438c979a1f21c2fa4 (patch)
treee9392b63d15549cdf4626a076a633a953f27b32d /tests/thypot.c
parent4dec763f276eca386383c8319c5f71b3e91441dc (diff)
downloadmpfr-10eecffeaa739ebe453ec87438c979a1f21c2fa4.tar.gz
hypot(±oo, NaN) now returns +oo, as in ISO C99 (wasn't documented).
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@3576 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/thypot.c')
-rw-r--r--tests/thypot.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/thypot.c b/tests/thypot.c
index e03cf2ae7..3de954e95 100644
--- a/tests/thypot.c
+++ b/tests/thypot.c
@@ -46,6 +46,16 @@ special (void)
mpfr_hypot (z, x, y, GMP_RNDN);
MPFR_ASSERTN(mpfr_inf_p (z) && mpfr_sgn (z) > 0);
+ mpfr_set_inf (x, -1);
+ mpfr_set_nan (y);
+ mpfr_hypot (z, x, y, GMP_RNDN);
+ MPFR_ASSERTN(mpfr_inf_p (z) && mpfr_sgn (z) > 0);
+
+ mpfr_set_nan (x);
+ mpfr_set_inf (y, -1);
+ mpfr_hypot (z, x, y, GMP_RNDN);
+ MPFR_ASSERTN(mpfr_inf_p (z) && mpfr_sgn (z) > 0);
+
mpfr_clear (x);
mpfr_clear (y);
mpfr_clear (z);