summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorenge <enge@211d60ee-9f03-0410-a15a-8952a2c7a4e4>2012-06-30 14:59:48 +0000
committerenge <enge@211d60ee-9f03-0410-a15a-8952a2c7a4e4>2012-06-30 14:59:48 +0000
commitcab9937d64bf3156debeeaf21bbe13ac7b648a31 (patch)
tree95ea16fd3822fcc3d3303fd67f2cad7af388612c /src
parentcb583a804d53d6cc3a4e0692134fee9e54253633 (diff)
downloadmpc-cab9937d64bf3156debeeaf21bbe13ac7b648a31.tar.gz
mpc-impl.h: added MPFR_OUT and MPC_OUT, useful for debugging
git-svn-id: svn://scm.gforge.inria.fr/svn/mpc/trunk@1216 211d60ee-9f03-0410-a15a-8952a2c7a4e4
Diffstat (limited to 'src')
-rw-r--r--src/mpc-impl.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/mpc-impl.h b/src/mpc-impl.h
index c3ca9af..b2aaa90 100644
--- a/src/mpc-impl.h
+++ b/src/mpc-impl.h
@@ -137,6 +137,27 @@ __MPC_DECLSPEC int mpfr_regular_p (mpfr_srcptr);
} while (0)
#endif
+
+/*
+ * Debug macros
+ */
+
+#define MPC_OUT(x) \
+do { \
+ printf (#x "[%lu,%lu]=", (unsigned long int) MPC_PREC_RE (x), \
+ (unsigned long int) MPC_PREC_IM (x)); \
+ mpc_out_str (stdout, 2, 0, x, MPC_RNDNN); \
+ printf ("\n"); \
+} while (0)
+
+#define MPFR_OUT(x) \
+do { \
+ printf (#x "[%lu]=", (unsigned long int) mpfr_get_prec (x)); \
+ mpfr_out_str (stdout, 2, 0, x, GMP_RNDN); \
+ printf ("\n"); \
+} while (0)
+
+
/*
* Constants
*/