summaryrefslogtreecommitdiff
path: root/add_ui.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2002-07-25 15:43:49 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2002-07-25 15:43:49 +0000
commit609684b566743c6a0426b3190736a1fd7568a864 (patch)
tree6d156cd58d229541f586d1f795e32e40ea987fef /add_ui.c
parent55f6a6d0a69136d56f30a6da63d5a539320b9d53 (diff)
downloadmpfr-609684b566743c6a0426b3190736a1fd7568a864.tar.gz
Function mpfr_check_range now propagates the inexact ternary value.
Function mpfr_restore_emin_emax OR's the saved flags with the current flags, as this is more useful in general. Macro MPFR_RESTORE_RET removed (no longer useful). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@1999 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'add_ui.c')
-rw-r--r--add_ui.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/add_ui.c b/add_ui.c
index 88de72071..85908f67a 100644
--- a/add_ui.c
+++ b/add_ui.c
@@ -28,7 +28,6 @@ MA 02111-1307, USA. */
int
mpfr_add_ui (mpfr_ptr y, mpfr_srcptr x, unsigned long int u, mp_rnd_t rnd_mode)
{
-
if (u) /* if u=0, do nothing */
{
mpfr_t uu;
@@ -46,7 +45,8 @@ mpfr_add_ui (mpfr_ptr y, mpfr_srcptr x, unsigned long int u, mp_rnd_t rnd_mode)
if mpfr_add works even when uu is out-of-range. */
mpfr_save_emin_emax();
inex = mpfr_add(y, x, uu, rnd_mode);
- MPFR_RESTORE_RET(inex, y, rnd_mode);
+ mpfr_restore_emin_emax();
+ return mpfr_check_range(y, inex, rnd_mode);
}
else
return mpfr_set (y, x, rnd_mode);