summaryrefslogtreecommitdiff
path: root/log.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 /log.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 'log.c')
-rw-r--r--log.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/log.c b/log.c
index 6c6e1f34b..90a7b217a 100644
--- a/log.c
+++ b/log.c
@@ -22,9 +22,9 @@ MA 02111-1307, USA. */
#include <stdio.h>
#include <math.h>
#include "gmp.h"
-#include "mpfr.h"
#include "gmp-impl.h"
-
+#include "mpfr.h"
+#include "mpfr-impl.h"
/* The computation of log(a) is done using the formula :
if we want p bits of the result,
@@ -40,10 +40,6 @@ MA 02111-1307, USA. */
so the relative error 4/s^2 is < 4/2^p i.e. 4 ulps.
*/
-
-#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; x -> _mp_exp = 0;
-
/* #define DEBUG */
int
@@ -117,13 +113,13 @@ mpfr_log(r, a, rnd_mode)
/* All the mpfr_t needed have a precision of p */
TMP_MARK(marker);
size=(p-1)/BITS_PER_MP_LIMB+1;
- MON_INIT(cstp, cst, p, size);
- MON_INIT(rapportp, rapport, p, size);
- MON_INIT(agmp, agm, p, size);
- MON_INIT(tmp1p, tmp1, p, size);
- MON_INIT(tmp2p, tmp2, p, size);
- MON_INIT(sp, s, p, size);
- MON_INIT(mmp, mm, p, size);
+ MPFR_INIT(cstp, cst, p, size);
+ MPFR_INIT(rapportp, rapport, p, size);
+ MPFR_INIT(agmp, agm, p, size);
+ MPFR_INIT(tmp1p, tmp1, p, size);
+ MPFR_INIT(tmp2p, tmp2, p, size);
+ MPFR_INIT(sp, s, p, size);
+ MPFR_INIT(mmp, mm, p, size);
mpfr_set_si(mm,m,GMP_RNDN); /* I have m, supposed exact */
mpfr_set_si(tmp1,1,GMP_RNDN); /* I have 1, exact */