summaryrefslogtreecommitdiff
path: root/sqrt_ui.c
diff options
context:
space:
mode:
authorpelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4>2004-11-18 14:52:59 +0000
committerpelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4>2004-11-18 14:52:59 +0000
commit054cdf7c885c574e6c111003c8767575a2a44666 (patch)
tree49713e889d7f8ccbdad01a07e92ff3cdf8f9c27e /sqrt_ui.c
parentef4cc77a66014090216445e952b0ccb9fc461e46 (diff)
downloadmpfr-054cdf7c885c574e6c111003c8767575a2a44666.tar.gz
Replace use of mpfr_save_emin_emax () / mpfr_restore_emin_emax()
by MPFR_SAVE_EXPO macros (DECL, MARK and FREE) which are faster and thread safe. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@3100 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'sqrt_ui.c')
-rw-r--r--sqrt_ui.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sqrt_ui.c b/sqrt_ui.c
index b3b95c1b0..3c2687f18 100644
--- a/sqrt_ui.c
+++ b/sqrt_ui.c
@@ -31,21 +31,21 @@ mpfr_sqrt_ui (mpfr_ptr r, unsigned long u, mp_rnd_t rnd_mode)
mp_limb_t up[1];
unsigned long cnt;
int inex;
+ MPFR_SAVE_EXPO_DECL (expo);
- MPFR_TMP_INIT1(up, uu, BITS_PER_MP_LIMB);
- MPFR_ASSERTN(u == (mp_limb_t) u);
+ MPFR_TMP_INIT1 (up, uu, BITS_PER_MP_LIMB);
+ MPFR_ASSERTN (u == (mp_limb_t) u);
count_leading_zeros (cnt, (mp_limb_t) u);
*up = (mp_limb_t) u << cnt;
- mpfr_save_emin_emax();
+ MPFR_SAVE_EXPO_MARK (expo);
MPFR_SET_EXP (uu, BITS_PER_MP_LIMB - cnt);
inex = mpfr_sqrt(r, uu, rnd_mode);
- mpfr_restore_emin_emax();
+ MPFR_SAVE_EXPO_FREE (expo);
return mpfr_check_range(r, inex, rnd_mode);
}
else /* sqrt(0) = 0 */
{
- MPFR_CLEAR_FLAGS(r);
MPFR_SET_ZERO(r);
MPFR_SET_POS(r);
MPFR_RET(0);