diff options
author | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2001-11-16 14:38:24 +0000 |
---|---|---|
committer | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2001-11-16 14:38:24 +0000 |
commit | 9139ea922ac39e09da34f033e6c8ba4845c56a02 (patch) | |
tree | fc98dba0c298d5d6880f2419aeb9f16eb31fead6 | |
parent | 7bbf44f6aa76af784f3e52ca3fdab5a15126cd6f (diff) | |
download | mpfr-9139ea922ac39e09da34f033e6c8ba4845c56a02.tar.gz |
mpfr_print_raw -> mpfr_print_binary
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@1558 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r-- | Makefile.in | 8 | ||||
-rw-r--r-- | exp_2.c | 10 | ||||
-rw-r--r-- | log.c | 6 | ||||
-rw-r--r-- | mpfr.h | 2 | ||||
-rw-r--r-- | mpfr.texi | 2 | ||||
-rw-r--r-- | print_raw.c | 4 | ||||
-rw-r--r-- | sub1.c | 10 | ||||
-rw-r--r-- | tests/tabs.c | 8 | ||||
-rw-r--r-- | tests/tadd.c | 38 | ||||
-rw-r--r-- | tests/tatan.c | 2 | ||||
-rw-r--r-- | tests/tcmp2.c | 24 | ||||
-rw-r--r-- | tests/tcos.c | 10 | ||||
-rw-r--r-- | tests/tdiv.c | 40 | ||||
-rw-r--r-- | tests/tdiv_ui.c | 12 | ||||
-rw-r--r-- | tests/teq.c | 4 | ||||
-rw-r--r-- | tests/teuler.c | 2 | ||||
-rw-r--r-- | tests/texceptions.c | 4 | ||||
-rw-r--r-- | tests/texp.c | 8 | ||||
-rw-r--r-- | tests/tfactorial.c | 4 | ||||
-rw-r--r-- | tests/tfma.c | 2 | ||||
-rw-r--r-- | tests/tgeneric.c | 8 | ||||
-rw-r--r-- | tests/thypot.c | 8 | ||||
-rw-r--r-- | tests/tlog.c | 2 | ||||
-rw-r--r-- | tests/tmul_ui.c | 18 | ||||
-rw-r--r-- | tests/tpow.c | 12 | ||||
-rw-r--r-- | tests/tpow3.c | 8 | ||||
-rw-r--r-- | tests/tset_d.c | 8 | ||||
-rw-r--r-- | tests/tset_si.c | 4 | ||||
-rw-r--r-- | tests/tset_str.c | 8 | ||||
-rw-r--r-- | tests/tsqrt.c | 10 | ||||
-rw-r--r-- | tests/tsub.c | 44 | ||||
-rw-r--r-- | tests/tsub_ui.c | 8 | ||||
-rw-r--r-- | tests/ttrunc.c | 18 | ||||
-rw-r--r-- | tests/tui_div.c | 6 | ||||
-rw-r--r-- | tests/tui_pow.c | 8 | ||||
-rw-r--r-- | tests/tui_sub.c | 8 | ||||
-rw-r--r-- | tests/tzeta.c | 6 |
37 files changed, 192 insertions, 192 deletions
diff --git a/Makefile.in b/Makefile.in index 07e6f87ab..b7c6117ad 100644 --- a/Makefile.in +++ b/Makefile.in @@ -75,7 +75,7 @@ include_HEADERS = mpfr.h mpf2mpfr.h mpfr-test.h lib_LIBRARIES = libmpfr.a -libmpfr_a_SOURCES = cputime.h mpfr.h mpfr-impl.h exceptions.c save_expo.c extract.c add.c add1.c add_ui.c add_ulp.c agm.c clear.c cmp.c cmp_abs.c cmp_ui.c div_2exp.c div.c div_ui.c dump.c eq.c exp2.c exp3.c exp.c get_str.c init.c inp_str.c isinteger.c isinf.c isnan.c isnum.c log2.c log.c mul_2exp.c mul.c mul_ui.c neg.c out_str.c pi.c pow.c pow_si.c pow_ui.c print_raw.c print_rnd_mode.c random2.c random.c reldiff.c rnd_mode.c round.c set.c set_d.c set_dfl_prec.c set_rnd.c set_f.c set_prc_raw.c set_prec.c set_q.c set_si.c set_str.c set_str_raw.c set_ui.c set_z.c sqrt.c sqrt_ui.c sub.c sub1.c sub_ui.c trunc.c ui_div.c ui_sub.c urandomb.c sqrtrem.c mpz_set_fr.c swap.c factorial.c cosh.c sinh.c tanh.c acosh.c asinh.c atanh.c atan.c cmp2.c exp_2.c asin.c euler.c cos.c sin.c tan.c fma.c hypot.c log1p.c expm1.c log_base_2.c ui_pow.c ui_pow_ui.c log_base_10.c minmax.c dim.c copysign.c gmp_op.c +libmpfr_a_SOURCES = cputime.h mpfr.h mpfr-impl.h exceptions.c save_expo.c extract.c add.c add1.c add_ui.c add_ulp.c agm.c clear.c cmp.c cmp_abs.c cmp_ui.c div_2exp.c div.c div_ui.c dump.c eq.c exp2.c exp3.c exp.c get_str.c init.c inp_str.c isinteger.c isinf.c isnan.c isnum.c log2.c log.c mul_2exp.c mul.c mul_ui.c neg.c out_str.c pi.c pow.c pow_si.c pow_ui.c print_raw.c print_rnd_mode.c random2.c random.c reldiff.c rnd_mode.c round.c set.c set_d.c set_dfl_prec.c set_rnd.c set_f.c set_prc_raw.c set_prec.c set_q.c set_si.c set_str.c set_str_raw.c set_ui.c set_z.c sqrt.c sqrt_ui.c sub.c sub1.c sub_ui.c trunc.c ui_div.c ui_sub.c urandomb.c sqrtrem.c mpz_set_fr.c swap.c factorial.c cosh.c sinh.c tanh.c acosh.c asinh.c atanh.c atan.c cmp2.c exp_2.c asin.c euler.c cos.c sin.c tan.c fma.c hypot.c log1p.c expm1.c log_base_2.c ui_pow.c ui_pow_ui.c log_base_10.c minmax.c dim.c copysign.c gmp_op.c init2.c libmpfr_a_LIBADD = ceil.o floor.o @@ -104,7 +104,7 @@ sqrt_ui.o sub.o sub1.o sub_ui.o trunc.o ui_div.o ui_sub.o urandomb.o \ sqrtrem.o mpz_set_fr.o swap.o factorial.o cosh.o sinh.o tanh.o acosh.o \ asinh.o atanh.o atan.o cmp2.o exp_2.o asin.o euler.o cos.o sin.o tan.o \ fma.o hypot.o log1p.o expm1.o log_base_2.o ui_pow.o ui_pow_ui.o \ -log_base_10.o minmax.o dim.o copysign.o gmp_op.o +log_base_10.o minmax.o dim.o copysign.o gmp_op.o init2.o AR = ar COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) @@ -132,8 +132,8 @@ DEP_FILES = .deps/acosh.P .deps/add.P .deps/add1.P .deps/add_ui.P \ .deps/euler.P .deps/exceptions.P .deps/exp.P .deps/exp2.P .deps/exp3.P \ .deps/exp_2.P .deps/expm1.P .deps/extract.P .deps/factorial.P \ .deps/fma.P .deps/get_str.P .deps/gmp_op.P .deps/hypot.P .deps/init.P \ -.deps/inp_str.P .deps/isinf.P .deps/isinteger.P .deps/isnan.P \ -.deps/isnum.P .deps/log.P .deps/log1p.P .deps/log2.P \ +.deps/init2.P .deps/inp_str.P .deps/isinf.P .deps/isinteger.P \ +.deps/isnan.P .deps/isnum.P .deps/log.P .deps/log1p.P .deps/log2.P \ .deps/log_base_10.P .deps/log_base_2.P .deps/minmax.P \ .deps/mpz_set_fr.P .deps/mul.P .deps/mul_2exp.P .deps/mul_ui.P \ .deps/neg.P .deps/out_str.P .deps/pi.P .deps/pow.P .deps/pow_si.P \ @@ -143,7 +143,7 @@ mpfr_exp_2 (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd_mode) in order to get an upper bound of r = x-n*log(2) */ mpfr_const_log2 (s, (n>=0) ? GMP_RNDZ : GMP_RNDU); #ifdef DEBUG - printf("n=%d log(2)=",n); mpfr_print_raw(s); putchar('\n'); + printf("n=%d log(2)=",n); mpfr_print_binary(s); putchar('\n'); #endif mpfr_mul_ui (r, s, (n<0) ? -n : n, (n>=0) ? GMP_RNDZ : GMP_RNDU); if (n<0) mpfr_neg(r, r, GMP_RNDD); @@ -151,9 +151,9 @@ mpfr_exp_2 (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd_mode) #ifdef DEBUG printf("x=%1.20e\n",mpfr_get_d(x)); - printf(" ="); mpfr_print_raw(x); putchar('\n'); + printf(" ="); mpfr_print_binary(x); putchar('\n'); printf("r=%1.20e\n",mpfr_get_d(r)); - printf(" ="); mpfr_print_raw(r); putchar('\n'); + printf(" ="); mpfr_print_binary(r); putchar('\n'); #endif mpfr_sub(r, x, r, GMP_RNDU); if (MPFR_SIGN(r)<0) { /* initial approximation n was too large */ @@ -164,7 +164,7 @@ mpfr_exp_2 (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd_mode) } #ifdef DEBUG printf("x-r=%1.20e\n",mpfr_get_d(r)); - printf(" ="); mpfr_print_raw(r); putchar('\n'); + printf(" ="); mpfr_print_binary(r); putchar('\n'); if (MPFR_SIGN(r)<0) { fprintf(stderr,"Error in mpfr_exp: r<0\n"); exit(1); } #endif mpfr_div_2exp(r, r, K, GMP_RNDU); /* r = (x-n*log(2))/2^K */ @@ -199,7 +199,7 @@ mpfr_exp_2 (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd_mode) #ifdef DEBUG printf("after mult. by 2^n:\n"); if (MPFR_EXP(s)>-1024) printf("s=%1.20e\n",mpfr_get_d(s)); - printf(" ="); mpfr_print_raw(s); putchar('\n'); + printf(" ="); mpfr_print_binary(s); putchar('\n'); printf("err=%d bits\n", K); #endif @@ -118,7 +118,7 @@ mpfr_log (mpfr_ptr r, mpfr_srcptr a, mp_rnd_t rnd_mode) while (bool==1) { #ifdef DEBUG - printf("a="); mpfr_print_raw(a); putchar('\n'); + printf("a="); mpfr_print_binary(a); putchar('\n'); printf("p=%d\n", p); #endif /* Calculus of m (depends on p) */ @@ -151,7 +151,7 @@ mpfr_log (mpfr_ptr r, mpfr_srcptr a, mp_rnd_t rnd_mode) cancel -= MPFR_EXP(cst); #ifdef DEBUG printf("cancelled bits=%d\n", cancel); - printf("approx="); mpfr_print_raw(cst); putchar('\n'); + printf("approx="); mpfr_print_binary(cst); putchar('\n'); #endif if (cancel<0) cancel=0; @@ -163,7 +163,7 @@ mpfr_log (mpfr_ptr r, mpfr_srcptr a, mp_rnd_t rnd_mode) if (mpfr_can_round (cst, p - cancel - 4, GMP_RNDN, rnd_mode, q) == 1) { inexact = mpfr_set (r, cst, rnd_mode); #ifdef DEBUG - printf("result="); mpfr_print_raw(r); putchar('\n'); + printf("result="); mpfr_print_binary(r); putchar('\n'); #endif bool=0; } @@ -140,7 +140,7 @@ double mpfr_get_d _PROTO ((mpfr_srcptr)); int mpfr_set_f _PROTO ((mpfr_ptr, mpf_srcptr, mp_rnd_t)); int mpfr_set_si _PROTO ((mpfr_ptr, long, mp_rnd_t)); int mpfr_set_ui _PROTO ((mpfr_ptr, unsigned long, mp_rnd_t)); -void mpfr_print_raw _PROTO ((mpfr_srcptr)); +void mpfr_print_binary _PROTO ((mpfr_srcptr)); void mpfr_random _PROTO ((mpfr_ptr)); void mpfr_random2 _PROTO ((mpfr_ptr, mp_size_t, mp_exp_t)); void mpfr_urandomb _PROTO ((mpfr_ptr, gmp_randstate_t)); @@ -1245,7 +1245,7 @@ numbers like @samp{0.23} are not interpreted as octal. Return the number of bytes read, or if an error occurred, return 0. @end deftypefun -@deftypefun void mpfr_print_raw (mpfr_t @var{float}) +@deftypefun void mpfr_print_binary (mpfr_t @var{float}) Output @var{float} on stdout in raw binary format (the exponent is in decimal, yet). The last bits from the least significant limb which do not belong to diff --git a/print_raw.c b/print_raw.c index c78c1faa1..0f127f2a1 100644 --- a/print_raw.c +++ b/print_raw.c @@ -1,4 +1,4 @@ -/* mpfr_print_raw -- print the internal binary representation of a +/* mpfr_print_binary -- print the internal binary representation of a floating-point number Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. @@ -59,7 +59,7 @@ mpfr_get_str_raw (char *digit_ptr, mpfr_srcptr x) } void -mpfr_print_raw (mpfr_srcptr x) +mpfr_print_binary (mpfr_srcptr x) { char *str; unsigned long alloc_size; @@ -44,8 +44,8 @@ mpfr_sub1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, #ifdef DEBUG printf("\nenter mpfr_sub, rnd_mode=%s:\n", mpfr_print_rnd_mode(rnd_mode)); - printf("b="); if (MPFR_SIGN(b)>0) putchar(' '); mpfr_print_raw(b); putchar('\n'); - printf("c="); if (MPFR_SIGN(c)>0) putchar(' '); for (k=0; k<diff_exp; k++) putchar(' '); mpfr_print_raw(c); putchar('\n'); + printf("b="); if (MPFR_SIGN(b)>0) putchar(' '); mpfr_print_binary(b); putchar('\n'); + printf("c="); if (MPFR_SIGN(c)>0) putchar(' '); for (k=0; k<diff_exp; k++) putchar(' '); mpfr_print_binary(c); putchar('\n'); printf("PREC(a)=%u PREC(b)=%u PREC(c)=%u\n", MPFR_PREC(a), MPFR_PREC(b), MPFR_PREC(c)); #endif @@ -145,7 +145,7 @@ mpfr_sub1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, MPN_ZERO (ap, an); #ifdef DEBUG - printf("after copying high(b), a="); mpfr_print_raw(a); putchar('\n'); + printf("after copying high(b), a="); mpfr_print_binary(a); putchar('\n'); #endif /* subtract high(c) */ @@ -183,7 +183,7 @@ mpfr_sub1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, } #ifdef DEBUG - printf("after subtracting high(c), a="); mpfr_print_raw(a); putchar('\n'); + printf("after subtracting high(c), a="); mpfr_print_binary(a); putchar('\n'); #endif /* now perform rounding */ @@ -398,7 +398,7 @@ mpfr_sub1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, } TMP_FREE(marker); #ifdef DEBUG - printf ("result is a="); mpfr_print_raw(a); putchar('\n'); + printf ("result is a="); mpfr_print_binary(a); putchar('\n'); #endif /* check that result is msb-normalized */ MPFR_ASSERTN(ap[an-1] > ~ap[an-1]); diff --git a/tests/tabs.c b/tests/tabs.c index 8b3a90cab..070718287 100644 --- a/tests/tabs.c +++ b/tests/tabs.c @@ -66,9 +66,9 @@ check_inexact () ((inexact < 0) && (cmp >= 0))) { fprintf (stderr, "Wrong inexact flag: expected %d, got %d\n", cmp, inexact); - printf ("x="); mpfr_print_raw (x); putchar ('\n'); - printf ("absx="); mpfr_print_raw (absx); putchar ('\n'); - printf ("y="); mpfr_print_raw (y); putchar ('\n'); + printf ("x="); mpfr_print_binary (x); putchar ('\n'); + printf ("absx="); mpfr_print_binary (absx); putchar ('\n'); + printf ("y="); mpfr_print_binary (y); putchar ('\n'); exit (1); } } @@ -133,7 +133,7 @@ main (int argc, char *argv[]) { fprintf(stderr, "Mismatch on d = %1.18g\n", d); - mpfr_print_raw(x); putchar('\n'); + mpfr_print_binary(x); putchar('\n'); exit(1); } } diff --git a/tests/tadd.c b/tests/tadd.c index a500c9397..357e8aec6 100644 --- a/tests/tadd.c +++ b/tests/tadd.c @@ -189,7 +189,7 @@ void check2 (double x, int px, double y, int py, int pz, mp_rnd_t rnd_mode) printf("got %1.20e\n",z2); printf("result should be %1.20e (diff=%d ulp)\n",z,u); mpfr_set_d(zz, z, rnd_mode); - printf("i.e."); mpfr_print_raw(zz); putchar('\n'); + printf("i.e."); mpfr_print_binary(zz); putchar('\n'); exit(1); } mpfr_clear(xx); mpfr_clear(yy); mpfr_clear(zz); } @@ -209,8 +209,8 @@ void check2a (double x, int px, double y, int py, int pz, mp_rnd_t rnd_mode, if (mpfr_cmp(xx, zz)) { printf("x=%1.20e,%d y=%1.20e,%d pz=%d,rnd=%s\n", x,px,y,py,pz,mpfr_print_rnd_mode(rnd_mode)); - printf("got "); mpfr_print_raw(zz); putchar('\n'); - printf("instead of "); mpfr_print_raw(xx); putchar('\n'); + printf("got "); mpfr_print_binary(zz); putchar('\n'); + printf("instead of "); mpfr_print_binary(xx); putchar('\n'); exit(1); } mpfr_clear(xx); mpfr_clear(yy); mpfr_clear(zz); @@ -250,7 +250,7 @@ void check64 () if (MPFR_MANT(u)[0] << 2) { fprintf (stderr, "result not normalized for prec=2\n"); - mpfr_print_raw (u); putchar ('\n'); + mpfr_print_binary (u); putchar ('\n'); exit (1); } mpfr_set_str_raw (t, "-1.0e-1"); @@ -302,7 +302,7 @@ void check64 () mpfr_sub(u, x, t, GMP_RNDU); mpfr_set_str_raw(t, "0.1011000101110010000101111111011100111111101010011011110110101011101000000100"); if (mpfr_cmp(u,t)) { - printf("expect "); mpfr_print_raw(t); putchar('\n'); + printf("expect "); mpfr_print_binary(t); putchar('\n'); fprintf (stderr, "mpfr_add failed for precisions 53-76\n"); exit(1); } mpfr_set_prec(x, 53); mpfr_set_prec(t, 108); mpfr_set_prec(u, 108); @@ -311,7 +311,7 @@ void check64 () mpfr_sub(u, x, t, GMP_RNDU); mpfr_set_str_raw(t, "0.101100010111001000010111111101110011111110101001101111011010101110100000001011000010101110011000000000111111"); if (mpfr_cmp(u,t)) { - printf("expect "); mpfr_print_raw(t); putchar('\n'); + printf("expect "); mpfr_print_binary(t); putchar('\n'); fprintf(stderr, "mpfr_add failed for precisions 53-108\n"); exit(1); } mpfr_set_prec(x, 97); mpfr_set_prec(t, 97); mpfr_set_prec(u, 97); @@ -357,9 +357,9 @@ void check64 () mpfr_add(u, x, t, GMP_RNDU); if ((MPFR_MANT(u)[0] & 1) != 1) { printf("error in mpfr_add with rnd_mode=GMP_RNDU\n"); - printf("b= "); mpfr_print_raw(x); putchar('\n'); - printf("c= "); mpfr_print_raw(t); putchar('\n'); - printf("b+c="); mpfr_print_raw(u); putchar('\n'); + printf("b= "); mpfr_print_binary(x); putchar('\n'); + printf("c= "); mpfr_print_binary(t); putchar('\n'); + printf("b+c="); mpfr_print_binary(u); putchar('\n'); exit(1); } @@ -472,9 +472,9 @@ void check_case_1b (void) if (mpfr_cmp_ui (a, 1) != 0) { fprintf (stderr, "case (1b) failed for prec_a=%u, prec_b=%u, prec_c=%u\n", prec_a, prec_b, prec_c); - printf("b="); mpfr_print_raw(b); putchar('\n'); - printf("c="); mpfr_print_raw(c); putchar('\n'); - printf("a="); mpfr_print_raw(a); putchar('\n'); + printf("b="); mpfr_print_binary(b); putchar('\n'); + printf("c="); mpfr_print_binary(c); putchar('\n'); + printf("a="); mpfr_print_binary(a); putchar('\n'); exit (1); } } @@ -592,9 +592,9 @@ check_inexact () if (mpfr_add (z, x, u, rnd)) { fprintf (stderr, "z <- x + u should be exact\n"); - printf ("x="); mpfr_print_raw (x); putchar ('\n'); - printf ("u="); mpfr_print_raw (u); putchar ('\n'); - printf ("z="); mpfr_print_raw (z); putchar ('\n'); + printf ("x="); mpfr_print_binary (x); putchar ('\n'); + printf ("u="); mpfr_print_binary (u); putchar ('\n'); + printf ("z="); mpfr_print_binary (z); putchar ('\n'); exit (1); } for (rnd=0; rnd<4; rnd++) @@ -608,10 +608,10 @@ check_inexact () fprintf (stderr, "Wrong inexact flag for rnd=%s\n", mpfr_print_rnd_mode(rnd)); printf ("expected %d, got %d\n", cmp, inexact); - printf ("x="); mpfr_print_raw (x); putchar ('\n'); - printf ("u="); mpfr_print_raw (u); putchar ('\n'); - printf ("y= "); mpfr_print_raw (y); putchar ('\n'); - printf ("x+u="); mpfr_print_raw (z); putchar ('\n'); + printf ("x="); mpfr_print_binary (x); putchar ('\n'); + printf ("u="); mpfr_print_binary (u); putchar ('\n'); + printf ("y= "); mpfr_print_binary (y); putchar ('\n'); + printf ("x+u="); mpfr_print_binary (z); putchar ('\n'); exit (1); } } diff --git a/tests/tatan.c b/tests/tatan.c index 0546d9dcc..cbf5ccc25 100644 --- a/tests/tatan.c +++ b/tests/tatan.c @@ -77,7 +77,7 @@ main (int argc, char *argv[]) mpfr_out_str (stdout, 2, prec, t, GMP_RNDN); putchar ('\n'); printf (" approximation was "); - mpfr_print_raw (y); + mpfr_print_binary (y); putchar ('\n'); exit (1); } diff --git a/tests/tcmp2.c b/tests/tcmp2.c index 568f5e860..61bfaaa1c 100644 --- a/tests/tcmp2.c +++ b/tests/tcmp2.c @@ -184,10 +184,10 @@ void special () if ((j = mpfr_cmp2 (x, y)) != 1) { printf ("Error in mpfr_cmp2:\n"); printf ("x="); - mpfr_print_raw (x); + mpfr_print_binary (x); putchar ('\n'); printf ("y="); - mpfr_print_raw (y); + mpfr_print_binary (y); putchar ('\n'); printf ("got %d, expected 1\n", j); exit (1); @@ -198,8 +198,8 @@ void special () mpfr_set_str_raw(y, "0.1011010000110111111000000101011011111100011101000011001111000010100010100110110100110010011001100110010000110010010110000010110E6"); if ((j=mpfr_cmp2(x, y)) != 32) { printf("Error in mpfr_cmp2:\n"); - printf("x="); mpfr_print_raw(x); putchar('\n'); - printf("y="); mpfr_print_raw(y); putchar('\n'); + printf("x="); mpfr_print_binary(x); putchar('\n'); + printf("y="); mpfr_print_binary(y); putchar('\n'); printf("got %d, expected 32\n", j); exit(1); } @@ -209,8 +209,8 @@ void special () mpfr_set_str_raw (y, "0.10001000110110000111011000101011111100110010010011001101000011111010010110001000000010100110100111111011011010101100011111111111111111111111111111111111111111111111011111100101011100011001101000100111000010000000000101100110000111111000101E167"); if ((j=mpfr_cmp2(x, y)) != 164) { printf("Error in mpfr_cmp2:\n"); - printf("x="); mpfr_print_raw(x); putchar('\n'); - printf("y="); mpfr_print_raw(y); putchar('\n'); + printf("x="); mpfr_print_binary(x); putchar('\n'); + printf("y="); mpfr_print_binary(y); putchar('\n'); printf("got %d, expected 164\n", j); exit(1); } @@ -221,8 +221,8 @@ void special () mpfr_set_str_raw (y, "0.1011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111100E2"); if ((j=mpfr_cmp2(x, y)) != 127) { printf("Error in mpfr_cmp2:\n"); - printf("x="); mpfr_print_raw(x); putchar('\n'); - printf("y="); mpfr_print_raw(y); putchar('\n'); + printf("x="); mpfr_print_binary(x); putchar('\n'); + printf("y="); mpfr_print_binary(y); putchar('\n'); printf("got %d, expected 127\n", j); exit(1); } @@ -233,8 +233,8 @@ void special () mpfr_set_str_raw (y, "0.10011111111111111111111111111111111111111111111111111111111111101E3"); if ((j=mpfr_cmp2(x, y)) != 63) { printf("Error in mpfr_cmp2:\n"); - printf("x="); mpfr_print_raw(x); putchar('\n'); - printf("y="); mpfr_print_raw(y); putchar('\n'); + printf("x="); mpfr_print_binary(x); putchar('\n'); + printf("y="); mpfr_print_binary(y); putchar('\n'); printf("got %d, expected 63\n", j); exit(1); } @@ -245,8 +245,8 @@ void special () mpfr_set_str_raw (y, "0.10011011111000101001101111111111111111111111111111111111111111101E-69"); if ((j=mpfr_cmp2(x, y)) != 63) { printf("Error in mpfr_cmp2:\n"); - printf("x="); mpfr_print_raw(x); putchar('\n'); - printf("y="); mpfr_print_raw(y); putchar('\n'); + printf("x="); mpfr_print_binary(x); putchar('\n'); + printf("y="); mpfr_print_binary(y); putchar('\n'); printf("got %d, expected 63\n", j); exit(1); } diff --git a/tests/tcos.c b/tests/tcos.c index 5b5ff0692..9b860ca4d 100644 --- a/tests/tcos.c +++ b/tests/tcos.c @@ -66,8 +66,8 @@ main (int argc, char *argv[]) if (mpfr_cmp (y, x)) { fprintf (stderr, "Error for prec=30, rnd=GMP_RNDU\n"); - printf ("expected "); mpfr_print_raw (x); putchar ('\n'); - printf (" got "); mpfr_print_raw (y); putchar ('\n'); + printf ("expected "); mpfr_print_binary (x); putchar ('\n'); + printf (" got "); mpfr_print_binary (y); putchar ('\n'); exit (1); } @@ -79,8 +79,8 @@ main (int argc, char *argv[]) if (mpfr_cmp (y, x)) { fprintf (stderr, "Error for prec=59, rnd=GMP_RNDU\n"); - printf ("expected "); mpfr_print_raw (x); putchar ('\n'); - printf (" got "); mpfr_print_raw (y); putchar ('\n'); + printf ("expected "); mpfr_print_binary (x); putchar ('\n'); + printf (" got "); mpfr_print_binary (y); putchar ('\n'); exit (1); } @@ -92,7 +92,7 @@ main (int argc, char *argv[]) if (mpfr_cmp (y, x)) { fprintf (stderr, "Error for x=1.1100e-2, rnd=GMP_RNDD\n"); - printf ("expected 1.1100e-1, got "); mpfr_print_raw (y); putchar ('\n'); + printf ("expected 1.1100e-1, got "); mpfr_print_binary (y); putchar ('\n'); exit (1); } diff --git a/tests/tdiv.c b/tests/tdiv.c index 48a0a9d04..9ce84c61c 100644 --- a/tests/tdiv.c +++ b/tests/tdiv.c @@ -142,8 +142,8 @@ void check_convergence () mpfr_set_str_raw(y, "0.10010010011011010100101001010111100000101110010010101E-529"); if (mpfr_cmp(x, y)) { fprintf(stderr, "Error in mpfr_div for prec=64, rnd=GMP_RNDN\n"); - printf("got "); mpfr_print_raw(x); putchar('\n'); - printf("instead of "); mpfr_print_raw(y); putchar('\n'); + printf("got "); mpfr_print_binary(x); putchar('\n'); + printf("instead of "); mpfr_print_binary(y); putchar('\n'); exit(1); } @@ -157,7 +157,7 @@ void check_convergence () if (mpfr_cmp_ui(y, 1)) { fprintf(stderr, "mpfr_div failed for x=1.0, y=1.0, prec=%u rnd=%s\n", i, mpfr_print_rnd_mode(j)); - printf("got "); mpfr_print_raw(y); putchar('\n'); + printf("got "); mpfr_print_binary(y); putchar('\n'); exit(1); } } @@ -190,8 +190,8 @@ void check_lowr () { fprintf(stderr, "Error in mpfr_div rnd=GMP_RNDN\n"); printf("Dividing "); - printf("got "); mpfr_print_raw(z2); putchar('\n'); - printf("instead of "); mpfr_print_raw(z); putchar('\n'); + printf("got "); mpfr_print_binary(z2); putchar('\n'); + printf("instead of "); mpfr_print_binary(z); putchar('\n'); printf("inex flag = %d\n", c); exit(1); } @@ -209,8 +209,8 @@ void check_lowr () { fprintf(stderr, "Error in mpfr_div rnd=GMP_RNDN\n"); printf("Dividing "); - printf("got "); mpfr_print_raw(z2); putchar('\n'); - printf("instead of "); mpfr_print_raw(z); putchar('\n'); + printf("got "); mpfr_print_binary(z2); putchar('\n'); + printf("instead of "); mpfr_print_binary(z); putchar('\n'); printf("inex flag = %d\n", c); exit(1); } @@ -221,8 +221,8 @@ void check_lowr () { fprintf(stderr, "Error in mpfr_div [even rnd?] rnd=GMP_RNDN\n"); printf("Dividing "); - printf("got "); mpfr_print_raw(z2); putchar('\n'); - printf("instead of "); mpfr_print_raw(z); putchar('\n'); + printf("got "); mpfr_print_binary(z2); putchar('\n'); + printf("instead of "); mpfr_print_binary(z); putchar('\n'); printf("inex flag = %d\n", 1); exit(1); } @@ -234,8 +234,8 @@ void check_lowr () { fprintf(stderr, "Error in mpfr_div [even rnd?] rnd=GMP_RNDN\n"); printf("Dividing "); - printf("got "); mpfr_print_raw(z2); putchar('\n'); - printf("instead of "); mpfr_print_raw(z); putchar('\n'); + printf("got "); mpfr_print_binary(z2); putchar('\n'); + printf("instead of "); mpfr_print_binary(z); putchar('\n'); printf("inex flag = %d\n", 1); exit(1); } @@ -265,8 +265,8 @@ void check_lowr () if (c != -1 || mpfr_cmp(z2, z)) { fprintf(stderr, "Error in mpfr_div rnd=GMP_RNDD\n"); - printf("got "); mpfr_print_raw(z2); putchar('\n'); - printf("instead of "); mpfr_print_raw(z); putchar('\n'); + printf("got "); mpfr_print_binary(z2); putchar('\n'); + printf("instead of "); mpfr_print_binary(z); putchar('\n'); printf("inex flag = %d\n", c); exit(1); } @@ -278,8 +278,8 @@ void check_lowr () if (c != 1 || mpfr_cmp(z2, z)) { fprintf(stderr, "Error in mpfr_div rnd=GMP_RNDU\n"); - printf("got "); mpfr_print_raw(z2); putchar('\n'); - printf("instead of "); mpfr_print_raw(z); putchar('\n'); + printf("got "); mpfr_print_binary(z2); putchar('\n'); + printf("instead of "); mpfr_print_binary(z); putchar('\n'); printf("inex flag = %d\n", c); exit(1); } @@ -329,7 +329,7 @@ check_inexact () { fprintf (stderr, "Wrong inexact flag (1): expected 1, got %d\n", inexact); - mpfr_print_raw(y); putchar('\n'); + mpfr_print_binary(y); putchar('\n'); exit (1); } @@ -361,10 +361,10 @@ check_inexact () fprintf (stderr, "Wrong inexact flag for rnd=%s\n", mpfr_print_rnd_mode(rnd)); printf ("expected %d, got %d\n", cmp, inexact); - printf ("x="); mpfr_print_raw (x); putchar ('\n'); - printf ("u="); mpfr_print_raw (u); putchar ('\n'); - printf ("y="); mpfr_print_raw (y); putchar ('\n'); - printf ("y*u="); mpfr_print_raw (z); putchar ('\n'); + printf ("x="); mpfr_print_binary (x); putchar ('\n'); + printf ("u="); mpfr_print_binary (u); putchar ('\n'); + printf ("y="); mpfr_print_binary (y); putchar ('\n'); + printf ("y*u="); mpfr_print_binary (z); putchar ('\n'); exit (1); } } diff --git a/tests/tdiv_ui.c b/tests/tdiv_ui.c index 5fcc5639b..7db5cb509 100644 --- a/tests/tdiv_ui.c +++ b/tests/tdiv_ui.c @@ -101,8 +101,8 @@ special (void) if (mpfr_get_d (x) != mpfr_get_d (y)) { fprintf (stderr, "division by 1.0 fails for xprec=%u, yprec=%u\n", xprec, yprec); - printf ("expected "); mpfr_print_raw (x); putchar ('\n'); - printf ("got "); mpfr_print_raw (y); putchar ('\n'); + printf ("expected "); mpfr_print_binary (x); putchar ('\n'); + printf ("got "); mpfr_print_binary (y); putchar ('\n'); exit (1); } } @@ -140,8 +140,8 @@ check_inexact () if (mpfr_mul_ui (z, y, u, rnd)) { fprintf (stderr, "z <- y * u should be exact for u=%lu\n", u); - printf ("y="); mpfr_print_raw (y); putchar ('\n'); - printf ("z="); mpfr_print_raw (z); putchar ('\n'); + printf ("y="); mpfr_print_binary (y); putchar ('\n'); + printf ("z="); mpfr_print_binary (z); putchar ('\n'); exit (1); } cmp = mpfr_cmp (z, x); @@ -151,8 +151,8 @@ check_inexact () { fprintf (stderr, "Wrong inexact flag for u=%lu, rnd=%s\n", u, mpfr_print_rnd_mode(rnd)); - printf ("x="); mpfr_print_raw (x); putchar ('\n'); - printf ("y="); mpfr_print_raw (y); putchar ('\n'); + printf ("x="); mpfr_print_binary (x); putchar ('\n'); + printf ("y="); mpfr_print_binary (y); putchar ('\n'); exit (1); } } diff --git a/tests/teq.c b/tests/teq.c index ded05aca8..87a421500 100644 --- a/tests/teq.c +++ b/tests/teq.c @@ -47,8 +47,8 @@ void teq (mpfr_t x) !mpfr_eq(y, x, k - 1)) { fprintf(stderr, "Error in eq.\n"); - printf("x = "); mpfr_print_raw(x); printf("\n"); - printf("y = "); mpfr_print_raw(y); printf("\n"); + printf("x = "); mpfr_print_binary(x); printf("\n"); + printf("y = "); mpfr_print_binary(y); printf("\n"); printf("k = %ld\n", k); printf("mpfr_eq(y, x, k) = %d\nmpfr_eq(y, x, k - 1) = %d\n", mpfr_eq(y, x, k),mpfr_eq(y, x, k - 1)); mpfr_clear(x); mpfr_clear(y); diff --git a/tests/teuler.c b/tests/teuler.c index c1a82e00d..d302e4cf0 100644 --- a/tests/teuler.c +++ b/tests/teuler.c @@ -74,7 +74,7 @@ main (int argc, char *argv[]) mpfr_out_str (stdout, 2, prec, t, GMP_RNDN); putchar ('\n'); printf (" approximation was "); - mpfr_print_raw (y); + mpfr_print_binary (y); putchar ('\n'); exit (1); } diff --git a/tests/texceptions.c b/tests/texceptions.c index 6c2b1b7e2..91a0790dd 100644 --- a/tests/texceptions.c +++ b/tests/texceptions.c @@ -92,7 +92,7 @@ main (int argc, char *argv[]) { fprintf (stderr, "Error: x+x rounded to nearest for x=2^1023 should give +Inf\n"); printf ("emax = %ld\n", mpfr_get_emax ()); - printf ("got "); mpfr_print_raw (x); putchar ('\n'); + printf ("got "); mpfr_print_binary (x); putchar ('\n'); exit (1); } @@ -112,7 +112,7 @@ main (int argc, char *argv[]) if (mpfr_cmp_ui (y, 0)) { fprintf (stderr, "Error: y-x rounded to zero should give 0 for y=3/2*2^(-1022), x=2^(-1022)\n"); - printf ("y="); mpfr_print_raw (y); putchar ('\n'); + printf ("y="); mpfr_print_binary (y); putchar ('\n'); exit (1); } diff --git a/tests/texp.c b/tests/texp.c index c613ab836..129b394ef 100644 --- a/tests/texp.c +++ b/tests/texp.c @@ -100,7 +100,7 @@ int check_large (double d, int n, mp_rnd_t rnd) else printf("exp(%1.20e)=",d); mpfr_out_str(stdout, 10, 0, y, rnd); putchar('\n'); - printf(" ="); mpfr_print_raw(y); putchar('\n'); + printf(" ="); mpfr_print_binary(y); putchar('\n'); if (n==53) printf(" =%1.20e\n", mpfr_get_d(y)); mpfr_clear(x); mpfr_clear(y); @@ -183,9 +183,9 @@ void compare_exp2_exp3 (int n) if (mpfr_cmp(y,z)) { printf("mpfr_exp_2 and mpfr_exp3 disagree for rnd=%s and\nx=", mpfr_print_rnd_mode(rnd)); - mpfr_print_raw(x); putchar('\n'); - printf("mpfr_exp_2 gives "); mpfr_print_raw(y); putchar('\n'); - printf("mpfr_exp3 gives "); mpfr_print_raw(z); putchar('\n'); + mpfr_print_binary(x); putchar('\n'); + printf("mpfr_exp_2 gives "); mpfr_print_binary(y); putchar('\n'); + printf("mpfr_exp3 gives "); mpfr_print_binary(z); putchar('\n'); exit(1); } } diff --git a/tests/tfactorial.c b/tests/tfactorial.c index 9656f4643..b78bbca8c 100644 --- a/tests/tfactorial.c +++ b/tests/tfactorial.c @@ -84,7 +84,7 @@ main (int argc, char *argv[]) { fprintf (stderr, "Wrong inexact flag: expected inexact\n"); printf ("n=%u prec=%u\n", n, prec); - mpfr_print_raw(z); putchar('\n'); + mpfr_print_binary(z); putchar('\n'); exit (1); } } @@ -101,7 +101,7 @@ main (int argc, char *argv[]) mpfr_out_str (stdout, 2, prec, t, GMP_RNDN); putchar ('\n'); printf (" approximation was "); - mpfr_print_raw (y); + mpfr_print_binary (y); putchar ('\n'); exit (1); } diff --git a/tests/tfma.c b/tests/tfma.c index 540203422..05360c033 100644 --- a/tests/tfma.c +++ b/tests/tfma.c @@ -275,7 +275,7 @@ main (int argc, char *argv[]) mpfr_out_str (stdout, 2, prec, t, GMP_RNDN); putchar ('\n'); printf ("approx "); - mpfr_print_raw (slong); + mpfr_print_binary (slong); putchar ('\n'); exit (1); } diff --git a/tests/tgeneric.c b/tests/tgeneric.c index d03e3ed9e..8ce1153cb 100644 --- a/tests/tgeneric.c +++ b/tests/tgeneric.c @@ -70,7 +70,7 @@ test_generic (int p0, int p1, int N) mpfr_out_str (stdout, 2, prec, t, GMP_RNDN); putchar ('\n'); printf ("approx "); - mpfr_print_raw (y); + mpfr_print_binary (y); putchar ('\n'); exit (1); } @@ -87,9 +87,9 @@ test_generic (int p0, int p1, int N) { fprintf (stderr, "Wrong inexact flag for rnd=%s: expected %d, got %d\n", mpfr_print_rnd_mode (rnd), compare, inexact); - printf ("x="); mpfr_print_raw (x); putchar ('\n'); - printf ("y="); mpfr_print_raw (y); putchar ('\n'); - printf ("t="); mpfr_print_raw (t); putchar ('\n'); + printf ("x="); mpfr_print_binary (x); putchar ('\n'); + printf ("y="); mpfr_print_binary (y); putchar ('\n'); + printf ("t="); mpfr_print_binary (t); putchar ('\n'); exit (1); } } diff --git a/tests/thypot.c b/tests/thypot.c index ff4deba81..739e54143 100644 --- a/tests/thypot.c +++ b/tests/thypot.c @@ -91,7 +91,7 @@ main (int argc, char *argv[]) mpfr_out_str (stdout, 2, prec, t, GMP_RNDN); putchar ('\n'); printf (" approximation was "); - mpfr_print_raw (y); + mpfr_print_binary (y); putchar ('\n'); exit (1); } @@ -108,9 +108,9 @@ main (int argc, char *argv[]) { fprintf (stderr, "Wrong inexact flag for rnd=%s: expected %d, got %d\n", mpfr_print_rnd_mode (rnd), compare, inexact); - printf ("x1="); mpfr_print_raw (x1); putchar ('\n'); - printf ("x2="); mpfr_print_raw (x2); putchar ('\n'); - printf ("t="); mpfr_print_raw (t); putchar ('\n'); + printf ("x1="); mpfr_print_binary (x1); putchar ('\n'); + printf ("x2="); mpfr_print_binary (x2); putchar ('\n'); + printf ("t="); mpfr_print_binary (t); putchar ('\n'); exit (1); } } diff --git a/tests/tlog.c b/tests/tlog.c index 0fca713c5..bbdda9638 100644 --- a/tests/tlog.c +++ b/tests/tlog.c @@ -104,7 +104,7 @@ void check3 (double d, unsigned long prec, mp_rnd_t rnd) mpfr_set_d(x, d, rnd); mpfr_log(y, x, rnd); mpfr_out_str(stdout, 10, 0, y, rnd); putchar('\n'); - mpfr_print_raw(y); putchar('\n'); + mpfr_print_binary(y); putchar('\n'); mpfr_clear(x); mpfr_clear(y); } diff --git a/tests/tmul_ui.c b/tests/tmul_ui.c index 0bc0f5d14..0512513f5 100644 --- a/tests/tmul_ui.c +++ b/tests/tmul_ui.c @@ -101,8 +101,8 @@ main (int argc, char *argv[]) if (mpfr_cmp (x, y)) { fprintf (stderr, "Error in mpfr_mul_ui: 1*y != y\n"); - printf ("y= "); mpfr_print_raw (y); putchar ('\n'); - printf ("1*y="); mpfr_print_raw (x); putchar ('\n'); + printf ("y= "); mpfr_print_binary (y); putchar ('\n'); + printf ("1*y="); mpfr_print_binary (x); putchar ('\n'); exit (1); } @@ -145,7 +145,7 @@ main (int argc, char *argv[]) mpfr_mul_ui(x, y, 4, GMP_RNDZ); if (mpfr_cmp_ui(x, 0) <= 0) { fprintf(stderr, "Error in mpfr_mul_ui: 4*3.0 does not give a positive result:\n"); - mpfr_print_raw(x); putchar('\n'); + mpfr_print_binary(x); putchar('\n'); printf("mpfr_cmp_ui(x, 0) = %d\n", mpfr_cmp_ui(x, 0)); exit(1); } @@ -158,7 +158,7 @@ main (int argc, char *argv[]) if (mpfr_cmp (x, y)) { fprintf (stderr, "Error in mul_ui for 1335*(0.100001111E9)\n"); - printf ("got "); mpfr_print_raw (x); putchar ('\n'); + printf ("got "); mpfr_print_binary (x); putchar ('\n'); exit(1); } @@ -171,7 +171,7 @@ main (int argc, char *argv[]) mpfr_set_str_raw(y, "0.1111101111010101111111100011010010111010111110110011001E67"); if (mpfr_cmp(x, y)) { printf("Error for 121*y: expected result is:\n"); - mpfr_print_raw(y); putchar('\n'); + mpfr_print_binary(y); putchar('\n'); } mpfr_set_prec (x, 32); @@ -198,8 +198,8 @@ main (int argc, char *argv[]) if (mpfr_cmp (x, y)) { printf ("Error for 23 * 2143861251406875.0\n"); - printf ("expected "); mpfr_print_raw (x); putchar ('\n'); - printf ("got "); mpfr_print_raw (y); putchar ('\n'); + printf ("expected "); mpfr_print_binary (x); putchar ('\n'); + printf ("got "); mpfr_print_binary (y); putchar ('\n'); exit (1); } @@ -215,8 +215,8 @@ main (int argc, char *argv[]) if (mpfr_get_d (x) != mpfr_get_d (y)) { fprintf (stderr, "multiplication by 1.0 fails for xprec=%u, yprec=%u\n", xprec, yprec); - printf ("expected "); mpfr_print_raw (x); putchar ('\n'); - printf ("got "); mpfr_print_raw (y); putchar ('\n'); + printf ("expected "); mpfr_print_binary (x); putchar ('\n'); + printf ("got "); mpfr_print_binary (y); putchar ('\n'); exit (1); } } diff --git a/tests/tpow.c b/tests/tpow.c index b47dd9697..dc26b4391 100644 --- a/tests/tpow.c +++ b/tests/tpow.c @@ -92,10 +92,10 @@ check_inexact (mp_prec_t p) { fprintf (stderr, "results differ for u=%lu rnd=%s\n", u, mpfr_print_rnd_mode(rnd)); - printf ("x="); mpfr_print_raw (x); putchar ('\n'); - printf ("y="); mpfr_print_raw (y); putchar ('\n'); - printf ("t="); mpfr_print_raw (t); putchar ('\n'); - printf ("z="); mpfr_print_raw (z); putchar ('\n'); + printf ("x="); mpfr_print_binary (x); putchar ('\n'); + printf ("y="); mpfr_print_binary (y); putchar ('\n'); + printf ("t="); mpfr_print_binary (t); putchar ('\n'); + printf ("z="); mpfr_print_binary (z); putchar ('\n'); exit (1); } if (((inexact == 0) && (cmp != 0)) || @@ -104,8 +104,8 @@ check_inexact (mp_prec_t p) fprintf (stderr, "Wrong inexact flag for p=%u, q=%u, rnd=%s\n", (unsigned) p, (unsigned) q, mpfr_print_rnd_mode (rnd)); printf ("expected %d, got %d\n", cmp, inexact); - printf ("u=%lu x=", u); mpfr_print_raw (x); putchar ('\n'); - printf ("y="); mpfr_print_raw (y); putchar ('\n'); + printf ("u=%lu x=", u); mpfr_print_binary (x); putchar ('\n'); + printf ("y="); mpfr_print_binary (y); putchar ('\n'); exit (1); } } diff --git a/tests/tpow3.c b/tests/tpow3.c index ab6c9e626..58fc2f80f 100644 --- a/tests/tpow3.c +++ b/tests/tpow3.c @@ -384,7 +384,7 @@ main (int argc, char *argv[]) mpfr_out_str (stdout, 2, prec, t, GMP_RNDN); putchar ('\n'); printf ("approx "); - mpfr_print_raw (y); + mpfr_print_binary (y); putchar ('\n'); exit (1); } @@ -401,9 +401,9 @@ main (int argc, char *argv[]) { fprintf (stderr, "Wrong inexact flag for rnd=%s: expected %d, got %d\n", mpfr_print_rnd_mode (rnd), compare, inexact); - printf ("x="); mpfr_print_raw (x); putchar ('\n'); - printf ("y="); mpfr_print_raw (y); putchar ('\n'); - printf ("t="); mpfr_print_raw (t); putchar ('\n'); + printf ("x="); mpfr_print_binary (x); putchar ('\n'); + printf ("y="); mpfr_print_binary (y); putchar ('\n'); + printf ("t="); mpfr_print_binary (t); putchar ('\n'); exit (1); } } diff --git a/tests/tset_d.c b/tests/tset_d.c index eae93a2c8..4eab276d0 100644 --- a/tests/tset_d.c +++ b/tests/tset_d.c @@ -45,13 +45,13 @@ main (int argc, char *argv[]) mpfr_init2(z, 32); mpfr_set_d(z, 1.0, 0); if (mpfr_get_d(z) != 1.0) { - mpfr_print_raw(z); putchar('\n'); + mpfr_print_binary(z); putchar('\n'); printf("Error: 1.0 != 1.0\n"); exit(1); } mpfr_set_prec(x, 53); mpfr_init2(y, 53); mpfr_set_d(x, d=-1.08007920352320089721e+150, 0); if (mpfr_get_d(x) != d) { - mpfr_print_raw(x); putchar('\n'); + mpfr_print_binary(x); putchar('\n'); printf("Error: get_d o set_d <> identity for d = %1.20e %1.20e\n",d, mpfr_get_d(x)); exit(1); } @@ -60,7 +60,7 @@ main (int argc, char *argv[]) d = -6.72658901114033715233e-165; mpfr_set_d(x, d, 0); if (d != mpfr_get_d(x)) { - mpfr_print_raw(x); putchar('\n'); + mpfr_print_binary(x); putchar('\n'); printf("Error: get_d o set_d <> identity for d = %1.20e %1.20e\n",d, mpfr_get_d(x)); exit(1); } @@ -74,7 +74,7 @@ main (int argc, char *argv[]) { fprintf(stderr, "Mismatch on : %1.18g != %1.18g\n", d, mpfr_get_d(x)); - mpfr_print_raw(x); putchar('\n'); + mpfr_print_binary(x); putchar('\n'); exit(1); } } diff --git a/tests/tset_si.c b/tests/tset_si.c index 1f2f82e1a..a5da95439 100644 --- a/tests/tset_si.c +++ b/tests/tset_si.c @@ -94,7 +94,7 @@ main (int argc, char *argv[]) || inex >= 0) { fprintf(stderr, "Error in mpfr_set_si(x:3, 77617, GMP_RNDD)\n"); - mpfr_print_raw(x); putchar('\n'); + mpfr_print_binary(x); putchar('\n'); exit(1); } inex = mpfr_set_ui(x, 77617, GMP_RNDD); /* should be 65536 */ @@ -102,7 +102,7 @@ main (int argc, char *argv[]) || inex >= 0) { fprintf(stderr, "Error in mpfr_set_ui(x:3, 77617, GMP_RNDD)\n"); - mpfr_print_raw(x); putchar('\n'); + mpfr_print_binary(x); putchar('\n'); exit(1); } diff --git a/tests/tset_str.c b/tests/tset_str.c index 6824b8a43..a26509da5 100644 --- a/tests/tset_str.c +++ b/tests/tset_str.c @@ -83,9 +83,9 @@ main (int argc, char *argv[]) if (mpfr_cmp (x, y)) { fprintf (stderr, "Error in mpfr_set_str\n"); - mpfr_print_raw(x); + mpfr_print_binary(x); putchar('\n'); - mpfr_print_raw(y); + mpfr_print_binary(y); putchar('\n'); mpfr_clear(x); mpfr_clear(y); @@ -149,11 +149,11 @@ main (int argc, char *argv[]) fprintf (stderr, "mpfr_set_str o mpfr_get_str <> id for rnd_mode=%s\n", mpfr_print_rnd_mode (k)); printf ("x="); - mpfr_print_raw (x); + mpfr_print_binary (x); putchar('\n'); printf ("s=%s, exp=%d, base=%d\n", str, (int) e, base); printf ("y="); - mpfr_print_raw (y); + mpfr_print_binary (y); putchar('\n'); mpfr_clear (x); mpfr_clear (y); diff --git a/tests/tsqrt.c b/tests/tsqrt.c index 8950a99ab..25cc6d54e 100644 --- a/tests/tsqrt.c +++ b/tests/tsqrt.c @@ -89,8 +89,8 @@ void check4 (double a, mp_rnd_t rnd_mode, char *Q) if (mpfr_cmp(q, res)) { printf("mpfr_sqrt failed for a=%1.20e, rnd_mode=%s\n", a, mpfr_print_rnd_mode(rnd_mode)); - printf("expected "); mpfr_print_raw(res); putchar('\n'); - printf("got "); mpfr_print_raw(q); putchar('\n'); + printf("expected "); mpfr_print_binary(res); putchar('\n'); + printf("got "); mpfr_print_binary(q); putchar('\n'); mpfr_clear(q); mpfr_clear(res); exit(1); } @@ -193,7 +193,7 @@ void special () if (mpfr_cmp_ui (x, 2)) { fprintf (stderr, "Error: sqrt(1+ulp(1), up) should give 2 (prec=%u)\n", (unsigned) p); - printf ("got "); mpfr_print_raw (x); putchar ('\n'); + printf ("got "); mpfr_print_binary (x); putchar ('\n'); exit (1); } } @@ -258,9 +258,9 @@ check_inexact (mp_prec_t p) fprintf (stderr, "Error: wrong inexact flag, expected %d, got %d\n", sign, inexact); printf ("x="); - mpfr_print_raw (x); + mpfr_print_binary (x); printf (" rnd=%s\n", mpfr_print_rnd_mode (rnd)); - printf ("y="); mpfr_print_raw (y); putchar ('\n'); + printf ("y="); mpfr_print_binary (y); putchar ('\n'); exit (1); } mpfr_clear (x); diff --git a/tests/tsub.c b/tests/tsub.c index a5319063d..cc5d59ad4 100644 --- a/tests/tsub.c +++ b/tests/tsub.c @@ -53,8 +53,8 @@ check_diverse () if (mpfr_cmp (z, y)) { fprintf (stderr, "Error in mpfr_sub (5)\n"); - printf ("expected "); mpfr_print_raw (y); putchar ('\n'); - printf ("got "); mpfr_print_raw (z); putchar ('\n'); + printf ("expected "); mpfr_print_binary (y); putchar ('\n'); + printf ("got "); mpfr_print_binary (z); putchar ('\n'); exit (1); } @@ -66,8 +66,8 @@ check_diverse () if (mpfr_cmp (z, y)) { fprintf (stderr, "Error in mpfr_sub (7)\n"); - printf ("expected "); mpfr_print_raw (y); putchar ('\n'); - printf ("got "); mpfr_print_raw (z); putchar ('\n'); + printf ("expected "); mpfr_print_binary (y); putchar ('\n'); + printf ("got "); mpfr_print_binary (z); putchar ('\n'); exit (1); } @@ -79,8 +79,8 @@ check_diverse () if (mpfr_cmp (z, y)) { fprintf (stderr, "Error in mpfr_sub (6)\n"); - printf ("expected "); mpfr_print_raw (y); putchar ('\n'); - printf ("got "); mpfr_print_raw (z); putchar ('\n'); + printf ("expected "); mpfr_print_binary (y); putchar ('\n'); + printf ("got "); mpfr_print_binary (z); putchar ('\n'); exit (1); } @@ -115,8 +115,8 @@ check_diverse () if (mpfr_cmp (x, y)) { fprintf (stderr, "Error in mpfr_sub (1 - 1E-33) with prec=33\n"); - printf ("Expected "); mpfr_print_raw (y); putchar ('\n'); - printf ("got "); mpfr_print_raw (x); putchar ('\n'); + printf ("Expected "); mpfr_print_binary (y); putchar ('\n'); + printf ("got "); mpfr_print_binary (x); putchar ('\n'); exit (1); } @@ -128,7 +128,7 @@ check_diverse () if (mpfr_cmp_ui (x, 1)) { fprintf (stderr, "Error in mpfr_sub (1 - 1E-33) with prec=32\n"); - printf ("Expected 1.0, got "); mpfr_print_raw (x); putchar ('\n'); + printf ("Expected 1.0, got "); mpfr_print_binary (x); putchar ('\n'); exit (1); } @@ -198,8 +198,8 @@ check_diverse () mpfr_sub (z, x, y, GMP_RNDN); if (mpfr_cmp (z, x)) { fprintf (stderr, "mpfr_sub(z, x, y) failed for prec(x)=112, prec(y)=98\n"); - printf ("expected "); mpfr_print_raw (x); putchar('\n'); - printf ("got "); mpfr_print_raw (z); putchar('\n'); + printf ("expected "); mpfr_print_binary (x); putchar('\n'); + printf ("got "); mpfr_print_binary (z); putchar('\n'); exit (1); } @@ -276,8 +276,8 @@ bug_ddefour() if (mpfr_cmp(ex2, ex3)) { fprintf (stderr, "Error in ddefour test.\n"); - printf ("ex2="); mpfr_print_raw (ex2); putchar ('\n'); - printf ("ex3="); mpfr_print_raw (ex3); putchar ('\n'); + printf ("ex2="); mpfr_print_binary (ex2); putchar ('\n'); + printf ("ex3="); mpfr_print_binary (ex3); putchar ('\n'); exit (1); } @@ -318,11 +318,11 @@ check_two_sum (mp_prec_t p) { fprintf (stderr, "Wrong inexact flag for prec=%u, rnd=%s\n", (unsigned)p, mpfr_print_rnd_mode (rnd)); - printf ("x="); mpfr_print_raw(x); putchar('\n'); - printf ("y="); mpfr_print_raw(y); putchar('\n'); - printf ("u="); mpfr_print_raw(u); putchar('\n'); - printf ("v="); mpfr_print_raw(v); putchar('\n'); - printf ("w="); mpfr_print_raw(w); putchar('\n'); + printf ("x="); mpfr_print_binary(x); putchar('\n'); + printf ("y="); mpfr_print_binary(y); putchar('\n'); + printf ("u="); mpfr_print_binary(u); putchar('\n'); + printf ("v="); mpfr_print_binary(v); putchar('\n'); + printf ("w="); mpfr_print_binary(w); putchar('\n'); printf ("inexact = %d\n", inexact); exit (1); } @@ -380,10 +380,10 @@ check_inexact () fprintf (stderr, "Wrong inexact flag for rnd=%s\n", mpfr_print_rnd_mode(rnd)); printf ("expected %d, got %d\n", cmp, inexact); - printf ("x="); mpfr_print_raw (x); putchar ('\n'); - printf ("u="); mpfr_print_raw (u); putchar ('\n'); - printf ("y= "); mpfr_print_raw (y); putchar ('\n'); - printf ("x-u="); mpfr_print_raw (z); putchar ('\n'); + printf ("x="); mpfr_print_binary (x); putchar ('\n'); + printf ("u="); mpfr_print_binary (u); putchar ('\n'); + printf ("y= "); mpfr_print_binary (y); putchar ('\n'); + printf ("x-u="); mpfr_print_binary (z); putchar ('\n'); exit (1); } } diff --git a/tests/tsub_ui.c b/tests/tsub_ui.c index 296fb1b4c..4d56ce99d 100644 --- a/tests/tsub_ui.c +++ b/tests/tsub_ui.c @@ -98,10 +98,10 @@ check_two_sum (mp_prec_t p) fprintf (stderr, "Wrong inexact flag for prec=%u, rnd=%s\n", (unsigned)p, mpfr_print_rnd_mode (rnd)); printf ("x=%u\n", x); - printf ("y="); mpfr_print_raw(y); putchar('\n'); - printf ("u="); mpfr_print_raw(u); putchar('\n'); - printf ("v="); mpfr_print_raw(v); putchar('\n'); - printf ("w="); mpfr_print_raw(w); putchar('\n'); + printf ("y="); mpfr_print_binary(y); putchar('\n'); + printf ("u="); mpfr_print_binary(u); putchar('\n'); + printf ("v="); mpfr_print_binary(v); putchar('\n'); + printf ("w="); mpfr_print_binary(w); putchar('\n'); printf ("inexact = %d\n", inexact); exit (1); } diff --git a/tests/ttrunc.c b/tests/ttrunc.c index 754dce02b..47752bef8 100644 --- a/tests/ttrunc.c +++ b/tests/ttrunc.c @@ -86,9 +86,9 @@ main (void) if (!mpfr_eq(y, y2, k)) { - printf("Error in floor, x = "); mpfr_print_raw(x); printf("\n"); - printf("floor(x) = "); mpfr_print_raw(y); printf("\n"); - printf("round(x, RNDD) = "); mpfr_print_raw(y2); printf("\n"); + printf("Error in floor, x = "); mpfr_print_binary(x); printf("\n"); + printf("floor(x) = "); mpfr_print_binary(y); printf("\n"); + printf("round(x, RNDD) = "); mpfr_print_binary(y2); printf("\n"); mpfr_clear(x); mpfr_clear(y); mpfr_clear(y2); @@ -101,9 +101,9 @@ main (void) if (!mpfr_eq(z, z2, k)) { - printf("Error in trunc, x = "); mpfr_print_raw(x); printf("\n"); - printf("trunc(x) = "); mpfr_print_raw(z); printf("\n"); - printf("round(x, RNDZ) = "); mpfr_print_raw(z2); printf("\n"); + printf("Error in trunc, x = "); mpfr_print_binary(x); printf("\n"); + printf("trunc(x) = "); mpfr_print_binary(z); printf("\n"); + printf("round(x, RNDZ) = "); mpfr_print_binary(z2); printf("\n"); mpfr_clear(x); mpfr_clear(y); mpfr_clear(y2); @@ -116,9 +116,9 @@ main (void) if (!mpfr_eq(y, y2, k)) { - printf("Error in ceil, x = "); mpfr_print_raw(x); printf("\n"); - printf("ceil(x) = "); mpfr_print_raw(t); printf("\n"); - printf("round(x, RNDU) = "); mpfr_print_raw(t2); printf("\n"); + printf("Error in ceil, x = "); mpfr_print_binary(x); printf("\n"); + printf("ceil(x) = "); mpfr_print_binary(t); printf("\n"); + printf("round(x, RNDU) = "); mpfr_print_binary(t2); printf("\n"); mpfr_clear(x); mpfr_clear(y); mpfr_clear(y2); diff --git a/tests/tui_div.c b/tests/tui_div.c index 42b0f45b8..78a98f079 100644 --- a/tests/tui_div.c +++ b/tests/tui_div.c @@ -94,9 +94,9 @@ check_inexact () fprintf (stderr, "Wrong inexact flag for u=%lu, rnd=%s\n", u, mpfr_print_rnd_mode(rnd)); printf ("expected %d, got %d\n", cmp, inexact); - printf ("x="); mpfr_print_raw (x); putchar ('\n'); - printf ("y="); mpfr_print_raw (y); putchar ('\n'); - printf ("y*x="); mpfr_print_raw (z); putchar ('\n'); + printf ("x="); mpfr_print_binary (x); putchar ('\n'); + printf ("y="); mpfr_print_binary (y); putchar ('\n'); + printf ("y*x="); mpfr_print_binary (z); putchar ('\n'); exit (1); } } diff --git a/tests/tui_pow.c b/tests/tui_pow.c index 1822647ff..69cb0dc6a 100644 --- a/tests/tui_pow.c +++ b/tests/tui_pow.c @@ -112,7 +112,7 @@ main (int argc, char *argv[]) mpfr_out_str (stdout, 2, prec, t, GMP_RNDN); putchar ('\n'); printf ("approx "); - mpfr_print_raw (y); + mpfr_print_binary (y); putchar ('\n'); exit (1); } @@ -129,9 +129,9 @@ main (int argc, char *argv[]) { fprintf (stderr, "Wrong inexact flag for rnd=%s: expected %d, got %d\n", mpfr_print_rnd_mode (rnd), compare, inexact); - printf ("x="); mpfr_print_raw (x); putchar ('\n'); - printf ("y="); mpfr_print_raw (y); putchar ('\n'); - printf ("t="); mpfr_print_raw (t); putchar ('\n'); + printf ("x="); mpfr_print_binary (x); putchar ('\n'); + printf ("y="); mpfr_print_binary (y); putchar ('\n'); + printf ("t="); mpfr_print_binary (t); putchar ('\n'); exit (1); } } diff --git a/tests/tui_sub.c b/tests/tui_sub.c index 6e8ccbdda..4a5a3f6db 100644 --- a/tests/tui_sub.c +++ b/tests/tui_sub.c @@ -186,10 +186,10 @@ check_two_sum (mp_prec_t p) fprintf (stderr, "Wrong inexact flag for prec=%u, rnd=%s\n", (unsigned)p, mpfr_print_rnd_mode (rnd)); printf ("x=%u\n", x); - printf ("y="); mpfr_print_raw(y); putchar('\n'); - printf ("u="); mpfr_print_raw(u); putchar('\n'); - printf ("v="); mpfr_print_raw(v); putchar('\n'); - printf ("w="); mpfr_print_raw(w); putchar('\n'); + printf ("y="); mpfr_print_binary(y); putchar('\n'); + printf ("u="); mpfr_print_binary(u); putchar('\n'); + printf ("v="); mpfr_print_binary(v); putchar('\n'); + printf ("w="); mpfr_print_binary(w); putchar('\n'); printf ("inexact = %d\n", inexact); exit (1); } diff --git a/tests/tzeta.c b/tests/tzeta.c index c32626224..dcba3d217 100644 --- a/tests/tzeta.c +++ b/tests/tzeta.c @@ -42,7 +42,7 @@ int main() mpfr_zeta(result,p,GMP_RNDN); #ifdef DEBUG printf("Valeur de zeta(2) avec prec=53 et arrondi au plus pres:\n"); - mpfr_print_raw(result);printf("\n"); + mpfr_print_binary(result);printf("\n"); t=mpfr_out_str(stdout,10,0,result,GMP_RNDN);printf("\n"); #endif if (mpfr_get_d(result) != 1.64493406684822640607e+00) { @@ -56,13 +56,13 @@ int main() mpfr_mul(p,p,p,GMP_RNDN); mpfr_set_ui(res_p,6,GMP_RNDN); mpfr_div(p,p,res_p,GMP_RNDN); - /*mpfr_print_raw(p);printf("\n"); + /*mpfr_print_binary(p);printf("\n"); t=mpfr_out_str(stdout,10,0,p,GMP_RNDN);printf("\n");*/ mpfr_can_round(p,63,GMP_RNDN,GMP_RNDN,53); mpfr_set(res_p,p,GMP_RNDN); #ifdef DEBUG printf("Valeur de pi^2/6 avec prec=53 et arrondi au plus pres:\n"); - mpfr_print_raw(res_p);printf("\n"); + mpfr_print_binary(res_p);printf("\n"); t=mpfr_out_str(stdout,10,0,res_p,GMP_RNDN);printf("\n"); #endif |