diff options
author | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2000-02-11 17:11:01 +0000 |
---|---|---|
committer | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2000-02-11 17:11:01 +0000 |
commit | 97bd41529e18ed73ccca21aef63a6624c3e1c36b (patch) | |
tree | c86d353a65137b6edc1495572f7dec2fbccba25d /log2.c | |
parent | 987ff75bf4b704c24e83dc1204a9a2f0c325894f (diff) | |
download | mpfr-97bd41529e18ed73ccca21aef63a6624c3e1c36b.tar.gz |
renamed to mpfr_const_log2
unsigned char -> mp_rnd_t
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@466 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'log2.c')
-rw-r--r-- | log2.c | 25 |
1 files changed, 13 insertions, 12 deletions
@@ -1,4 +1,4 @@ -/* mpfr_log2 -- compute natural logarithm of 2 +/* mpfr_const_log2 -- compute natural logarithm of 2 Copyright (C) 1999 PolKA project, Inria Lorraine and Loria @@ -26,8 +26,8 @@ MA 02111-1307, USA. */ #include "longlong.h" #include "mpfr.h" -mpfr_t __mpfr_log2; /* stored value of log(2) with rnd_mode=GMP_RNDZ */ -int __mpfr_log2_prec=0; /* precision of stored value */ +mpfr_t __mpfr_const_log2; /* stored value of log(2) with rnd_mode=GMP_RNDZ */ +int __mpfr_const_log2_prec=0; /* precision of stored value */ /* set x to log(2) rounded to precision PREC(x) with direction rnd_mode @@ -44,9 +44,9 @@ int __mpfr_log2_prec=0; /* precision of stored value */ */ void #if __STDC__ -mpfr_log2(mpfr_ptr x, unsigned char rnd_mode) +mpfr_const_log2(mpfr_ptr x, mp_rnd_t rnd_mode) #else -mpfr_log2(x, rnd_mode) mpfr_ptr x; unsigned char rnd_mode; +mpfr_const_log2(x, rnd_mode) mpfr_ptr x; mp_rnd_t rnd_mode; #endif { int N, oldN, k, precx; mpz_t s, t, u; @@ -54,11 +54,12 @@ mpfr_log2(x, rnd_mode) mpfr_ptr x; unsigned char rnd_mode; precx = PREC(x); /* has stored value enough precision ? */ - if (precx <= __mpfr_log2_prec) { + if (precx <= __mpfr_const_log2_prec) { if (rnd_mode==GMP_RNDZ || rnd_mode==GMP_RNDD || - mpfr_can_round(__mpfr_log2, __mpfr_log2_prec, GMP_RNDZ, rnd_mode, precx)) + mpfr_can_round(__mpfr_const_log2, __mpfr_const_log2_prec, GMP_RNDZ, + rnd_mode, precx)) { - mpfr_set(x, __mpfr_log2, rnd_mode); return; + mpfr_set(x, __mpfr_const_log2, rnd_mode); return; } } @@ -93,10 +94,10 @@ mpfr_log2(x, rnd_mode) mpfr_ptr x; unsigned char rnd_mode; EXP(x) -= N; /* stored computed value */ - if (__mpfr_log2_prec==0) mpfr_init2(__mpfr_log2, precx); - else mpfr_set_prec(__mpfr_log2, precx); - mpfr_set(__mpfr_log2, x, GMP_RNDZ); - __mpfr_log2_prec=precx; + if (__mpfr_const_log2_prec==0) mpfr_init2(__mpfr_const_log2, precx); + else mpfr_set_prec(__mpfr_const_log2, precx); + mpfr_set(__mpfr_const_log2, x, GMP_RNDZ); + __mpfr_const_log2_prec=precx; mpz_clear(s); mpz_clear(t); mpz_clear(u); } |