summaryrefslogtreecommitdiff
path: root/sub_ui.c
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2000-12-18 09:02:00 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2000-12-18 09:02:00 +0000
commit9c94b291ca1c5929ce7ca2927f7506045278cdc0 (patch)
treecb2b32a4711bcfd793f8a30fc60de441bc47ee6c /sub_ui.c
parent177371d41c4d432af5863e7c053d3e6439e6283d (diff)
downloadmpfr-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 'sub_ui.c')
-rw-r--r--sub_ui.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/sub_ui.c b/sub_ui.c
index 9ef5a6a54..1aa473c99 100644
--- a/sub_ui.c
+++ b/sub_ui.c
@@ -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_sub_ui (y, x, u, 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)) {
MPFR_SET_NAN(y);
@@ -56,14 +53,11 @@ mpfr_sub_ui (y, x, u, rnd_mode)
}
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;
mpfr_sub (y, x, uu, rnd_mode);
-
- TMP_FREE(marker);
}
}