diff options
author | pelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4> | 2004-11-18 14:52:59 +0000 |
---|---|---|
committer | pelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4> | 2004-11-18 14:52:59 +0000 |
commit | 054cdf7c885c574e6c111003c8767575a2a44666 (patch) | |
tree | 49713e889d7f8ccbdad01a07e92ff3cdf8f9c27e /sqrt_ui.c | |
parent | ef4cc77a66014090216445e952b0ccb9fc461e46 (diff) | |
download | mpfr-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.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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); |