diff options
author | Andreas Enge <andreas.enge@inria.fr> | 2012-06-30 14:59:48 +0000 |
---|---|---|
committer | Andreas Enge <andreas.enge@inria.fr> | 2012-06-30 14:59:48 +0000 |
commit | 3ca2857af19117944f995911fbb244425a95162e (patch) | |
tree | 95ea16fd3822fcc3d3303fd67f2cad7af388612c | |
parent | 071fbdde8d9e911422070f1d1fcf20be64531765 (diff) | |
download | mpc-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.h | 21 |
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 */ |