summaryrefslogtreecommitdiff
path: root/sqrt.c
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2000-12-15 17:11:49 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2000-12-15 17:11:49 +0000
commit0fc8be56956c19b24c02c1e2299df746c5865382 (patch)
tree5b71c6438a696f0b55566848df1abd0edf18b555 /sqrt.c
parent3f3cd6e438e072fef65a470c3a56d4147d7e5c4e (diff)
downloadmpfr-0fc8be56956c19b24c02c1e2299df746c5865382.tar.gz
clear NaN/Inf flags in normal case
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@885 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'sqrt.c')
-rw-r--r--sqrt.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sqrt.c b/sqrt.c
index ebda6c809..1c27a58d9 100644
--- a/sqrt.c
+++ b/sqrt.c
@@ -49,7 +49,10 @@ mpfr_sqrt (r, u, rnd_mode)
char can_round = 0;
TMP_DECL (marker); TMP_DECL(marker0);
- if (MPFR_IS_NAN(u) || MPFR_SIGN(u) == -1) { MPFR_SET_NAN(r); return 1; }
+ if (MPFR_IS_NAN(u) || MPFR_SIGN(u) == -1) {
+ MPFR_SET_NAN(r);
+ return 1;
+ }
if (MPFR_SIGN(r) != 1) { MPFR_CHANGE_SIGN(r); }
if (MPFR_IS_INF(u))
@@ -58,6 +61,8 @@ mpfr_sqrt (r, u, rnd_mode)
return 1;
}
+ MPFR_CLEAR_FLAGS (r);
+
prec = MPFR_PREC(r);
if (!MPFR_NOTZERO(u))