summaryrefslogtreecommitdiff
path: root/sub.c
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2000-12-21 17:08:38 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2000-12-21 17:08:38 +0000
commitc74d024d1bfb5cffbd9cf27664f824bb4087dda8 (patch)
tree5785612341cfeeaab51d555c975ec973b480292a /sub.c
parent783f93b38a3d8264f81fb1b303c11c9e9cd9c27e (diff)
downloadmpfr-c74d024d1bfb5cffbd9cf27664f824bb4087dda8.tar.gz
k2r -> ansi style
removed #include <math.h> by defining auxiliary functions fixed several tiny remaining bugs with NaN/Inf git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@925 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'sub.c')
-rw-r--r--sub.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sub.c b/sub.c
index f9805d058..cac3e7156 100644
--- a/sub.c
+++ b/sub.c
@@ -525,6 +525,8 @@ mpfr_sub (a, b, c, rnd_mode)
MPFR_SET_NAN(a);
return;
}
+
+ MPFR_CLEAR_NAN(a);
if (MPFR_IS_INF(b))
{
@@ -543,18 +545,20 @@ mpfr_sub (a, b, c, rnd_mode)
MPFR_SET_INF(a);
if (MPFR_SIGN(b) != MPFR_SIGN(a)) { MPFR_CHANGE_SIGN(a); }
}
+ return;
}
else
if (MPFR_IS_INF(c))
{
MPFR_SET_INF(a);
if (MPFR_SIGN(c) == MPFR_SIGN(a)) { MPFR_CHANGE_SIGN(a); }
+ return;
}
if (!MPFR_NOTZERO(b)) { mpfr_neg(a, c, rnd_mode); return; }
if (!MPFR_NOTZERO(c)) { mpfr_set(a, b, rnd_mode); return; }
- MPFR_CLEAR_FLAGS (a);
+ MPFR_CLEAR_INF(a);
diff_exp = MPFR_EXP(b)-MPFR_EXP(c);
if (MPFR_SIGN(b) == MPFR_SIGN(c)) {