summaryrefslogtreecommitdiff
path: root/exceptions.c
diff options
context:
space:
mode:
authorpelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4>2004-09-29 12:27:36 +0000
committerpelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4>2004-09-29 12:27:36 +0000
commit8eb22ba63830dbf829b9faa742c68438c43992d9 (patch)
tree3482ee8bed089b988aae3d20dda76cede0dab587 /exceptions.c
parent795c8ef5f9daa924b5592582240c9ba9a58034c1 (diff)
downloadmpfr-8eb22ba63830dbf829b9faa742c68438c43992d9.tar.gz
Add mpfr_clear_erangeflag and mpfr_erangeflag_p.
Add test for theses two functions. mpfr_get_[s/u][i/j] have a deterministic behavior in case of OVERFLOW. (Return the MINIMUM or the MAXIMUM in the current type, and set ERANGE_flag). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@3007 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'exceptions.c')
-rw-r--r--exceptions.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/exceptions.c b/exceptions.c
index 8ca0a1e48..a144c0ffa 100644
--- a/exceptions.c
+++ b/exceptions.c
@@ -138,6 +138,14 @@ mpfr_clear_inexflag (void)
__gmpfr_flags &= MPFR_FLAGS_ALL ^ MPFR_FLAGS_INEXACT;
}
+#undef mpfr_clear_erangeflag
+
+void
+mpfr_clear_erangeflag (void)
+{
+ __gmpfr_flags &= MPFR_FLAGS_ALL ^ MPFR_FLAGS_ERANGE;
+}
+
#undef mpfr_check_range
int
@@ -200,6 +208,14 @@ mpfr_inexflag_p (void)
return __gmpfr_flags & MPFR_FLAGS_INEXACT;
}
+#undef mpfr_erangeflag_p
+
+int
+mpfr_erangeflag_p (void)
+{
+ return __gmpfr_flags & MPFR_FLAGS_ERANGE;
+}
+
/* #undef mpfr_set_underflow */
/* Note: In the rounding to the nearest mode, mpfr_set_underflow