summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Enge <andreas.enge@inria.fr>2012-06-30 14:59:48 +0000
committerAndreas Enge <andreas.enge@inria.fr>2012-06-30 14:59:48 +0000
commit3ca2857af19117944f995911fbb244425a95162e (patch)
tree95ea16fd3822fcc3d3303fd67f2cad7af388612c
parent071fbdde8d9e911422070f1d1fcf20be64531765 (diff)
downloadmpc-git-3ca2857af19117944f995911fbb244425a95162e.tar.gz
mpc-impl.h: added MPFR_OUT and MPC_OUT, useful for debugging
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/mpc/trunk@1216 211d60ee-9f03-0410-a15a-8952a2c7a4e4
-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
*/