diff options
Diffstat (limited to 'sqrt_ui.c')
-rw-r--r-- | sqrt_ui.c | 14 |
1 files changed, 4 insertions, 10 deletions
@@ -19,16 +19,14 @@ along with the MPFR Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#define MON_INIT(xp, x, p, s) xp = (mp_ptr) TMP_ALLOC(s*BYTES_PER_MP_LIMB); \ - MPFR_PREC(x) = p; MPFR_MANT(x) = xp; x -> _mp_size = s; - #include <math.h> #include <stdio.h> #include <stdlib.h> #include "gmp.h" #include "gmp-impl.h" -#include "mpfr.h" #include "longlong.h" +#include "mpfr.h" +#include "mpfr-impl.h" int #if __STDC__ @@ -42,20 +40,16 @@ mpfr_sqrt_ui (r, u, rnd_mode) { int error = 0; mpfr_t uu; - mp_limb_t *up; + mp_limb_t up[1]; unsigned long cnt; - TMP_DECL(marker); if (u) { /* if u=0, do nothing */ - TMP_MARK(marker); - MON_INIT(up, uu, BITS_PER_MP_LIMB, 1); + MPFR_INIT1(up, uu, BITS_PER_MP_LIMB, 1); count_leading_zeros(cnt, (mp_limb_t) u); *up = (mp_limb_t) u << cnt; MPFR_EXP(uu) = BITS_PER_MP_LIMB-cnt; error = mpfr_sqrt(r, uu, rnd_mode); - - TMP_FREE(marker); } else { MPFR_CLEAR_FLAGS(r); |