From cab9937d64bf3156debeeaf21bbe13ac7b648a31 Mon Sep 17 00:00:00 2001 From: enge Date: Sat, 30 Jun 2012 14:59:48 +0000 Subject: 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 --- src/mpc-impl.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src') 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 */ -- cgit v1.2.1