diff options
author | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2000-12-18 09:02:00 +0000 |
---|---|---|
committer | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2000-12-18 09:02:00 +0000 |
commit | 9c94b291ca1c5929ce7ca2927f7506045278cdc0 (patch) | |
tree | cb2b32a4711bcfd793f8a30fc60de441bc47ee6c /ui_div.c | |
parent | 177371d41c4d432af5863e7c053d3e6439e6283d (diff) | |
download | mpfr-9c94b291ca1c5929ce7ca2927f7506045278cdc0.tar.gz |
changed name of mpfr struct fields: _mp_d -> _mpfr_d
(to detect conflicts with mpf)
fixed a few problems in non-STDC headers
moved definitions of mpfr-impl.h to mpfr-test.h and created a real mpfr-impl.h
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@897 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'ui_div.c')
-rw-r--r-- | ui_div.c | 14 |
1 files changed, 4 insertions, 10 deletions
@@ -21,12 +21,10 @@ MA 02111-1307, USA. */ #include <stdio.h> #include "gmp.h" -#include "mpfr.h" #include "gmp-impl.h" #include "longlong.h" - -#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 "mpfr.h" +#include "mpfr-impl.h" void #if __STDC__ @@ -40,9 +38,8 @@ mpfr_ui_div (y, u, x, rnd_mode) #endif { mpfr_t uu; - mp_limb_t *up; + mp_limb_t up[1]; unsigned long cnt; - TMP_DECL(marker); if (MPFR_IS_NAN(x)) { @@ -60,15 +57,12 @@ mpfr_ui_div (y, u, x, rnd_mode) } if (u) { - 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; mpfr_div(y, uu, x, rnd_mode); - - TMP_FREE(marker); } else { if (MPFR_IS_ZERO(x)) MPFR_SET_NAN(y); /* 0/0 */ |