summaryrefslogtreecommitdiff
path: root/const_pi.c
diff options
context:
space:
mode:
authorpelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4>2005-02-03 14:59:39 +0000
committerpelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4>2005-02-03 14:59:39 +0000
commit322eedfed5269686a73496b2d44e0e4fdc7acd66 (patch)
tree3da132a5eac62affbe1c30484fae45db5d8d34c2 /const_pi.c
parentdd38a571d3b1e52cad19346b0ab7ecc54b2b3f7c (diff)
downloadmpfr-322eedfed5269686a73496b2d44e0e4fdc7acd66.tar.gz
Change user interface for mpfr_const_pi, mpfr_const_log2 and
mpfr_const_euler. No more access to the cache itself. Create dummy functions which call the cache, and rename old functions to "_internal". Internally, it doesn't change at all (You still call directly the cache instead of the dummy function which calls the cache). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@3271 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'const_pi.c')
-rw-r--r--const_pi.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/const_pi.c b/const_pi.c
index 8f63161d0..de51efe8d 100644
--- a/const_pi.c
+++ b/const_pi.c
@@ -21,6 +21,16 @@ MA 02111-1307, USA. */
#include "mpfr-impl.h"
+/* Declare the cache */
+MPFR_DECL_INIT_CACHE(__gmpfr_cache_const_pi, mpfr_const_pi_internal);
+
+/* Set User Interface */
+#undef mpfr_const_pi
+int
+mpfr_const_pi (mpfr_ptr x, mp_rnd_t rnd_mode) {
+ return mpfr_cache (x, __gmpfr_cache_const_pi, rnd_mode);
+}
+
/* Time: mpfr_const_pi2 is this new version.
norroy% time ./pi2 1000000
mpfr_const_pi took 14110ms
@@ -35,7 +45,7 @@ MA 02111-1307, USA. */
mpfr_const_pi2 took 51780ms */
int
-(mpfr_const_pi) (mpfr_ptr x, mp_rnd_t rnd_mode)
+mpfr_const_pi_internal (mpfr_ptr x, mp_rnd_t rnd_mode)
{
mpfr_t a, A, B, D, S;
mp_prec_t px, p, cancel, k, kmax;