diff options
Diffstat (limited to 'mpfr')
37 files changed, 203 insertions, 207 deletions
diff --git a/mpfr/tests/tabs.c b/mpfr/tests/tabs.c index 8c86a0f63..aa984f5d5 100644 --- a/mpfr/tests/tabs.c +++ b/mpfr/tests/tabs.c @@ -64,9 +64,9 @@ check_inexact (void) ((inexact < 0) && (cmp >= 0))) { fprintf (stderr, "Wrong inexact flag: expected %d, got %d\n", cmp, inexact); - printf ("x="); mpfr_print_binary (x); putchar ('\n'); - printf ("absx="); mpfr_print_binary (absx); putchar ('\n'); - printf ("y="); mpfr_print_binary (y); putchar ('\n'); + printf ("x="); mpfr_print_binary (x); puts (""); + printf ("absx="); mpfr_print_binary (absx); puts (""); + printf ("y="); mpfr_print_binary (y); puts (""); exit (1); } } @@ -141,7 +141,7 @@ main (int argc, char *argv[]) fprintf(stderr, "Mismatch on d = %.20e\n", d); fprintf(stderr, "dd=%.20e\n", dd); - mpfr_print_binary(x); putchar('\n'); + mpfr_print_binary(x); puts (""); exit(1); } } diff --git a/mpfr/tests/tacos.c b/mpfr/tests/tacos.c index 58814f2b7..35da08bed 100644 --- a/mpfr/tests/tacos.c +++ b/mpfr/tests/tacos.c @@ -82,10 +82,10 @@ main (void) mpfr_print_rnd_mode (rnd)); printf (" got "); mpfr_out_str (stdout, 2, prec, z, GMP_RNDN); - putchar ('\n'); + puts (""); printf (" expected "); mpfr_out_str (stdout, 2, prec, y, GMP_RNDN); - putchar ('\n'); + puts (""); } } } diff --git a/mpfr/tests/tadd.c b/mpfr/tests/tadd.c index 694e65c96..fbe71bf99 100644 --- a/mpfr/tests/tadd.c +++ b/mpfr/tests/tadd.c @@ -180,7 +180,7 @@ check64 (void) mpfr_sub(u, x, t, GMP_RNDU); mpfr_set_str_raw(t, "0.1011000101110010000101111111011100111111101010011011110110101011101000000100"); if (mpfr_cmp(u,t)) { - printf("expect "); mpfr_print_binary(t); putchar('\n'); + printf("expect "); mpfr_print_binary(t); puts (""); 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); @@ -189,7 +189,7 @@ check64 (void) mpfr_sub(u, x, t, GMP_RNDU); mpfr_set_str_raw(t, "0.101100010111001000010111111101110011111110101001101111011010101110100000001011000010101110011000000000111111"); if (mpfr_cmp(u,t)) { - printf("expect "); mpfr_print_binary(t); putchar('\n'); + printf("expect "); mpfr_print_binary(t); puts (""); 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); @@ -235,9 +235,9 @@ check64 (void) 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_binary(x); putchar('\n'); - printf("c= "); mpfr_print_binary(t); putchar('\n'); - printf("b+c="); mpfr_print_binary(u); putchar('\n'); + printf("b= "); mpfr_print_binary(x); puts (""); + printf("c= "); mpfr_print_binary(t); puts (""); + printf("b+c="); mpfr_print_binary(u); puts (""); exit(1); } @@ -351,9 +351,9 @@ 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_binary(b); putchar('\n'); - printf("c="); mpfr_print_binary(c); putchar('\n'); - printf("a="); mpfr_print_binary(a); putchar('\n'); + printf("b="); mpfr_print_binary(b); puts (""); + printf("c="); mpfr_print_binary(c); puts (""); + printf("a="); mpfr_print_binary(a); puts (""); exit (1); } } diff --git a/mpfr/tests/tasin.c b/mpfr/tests/tasin.c index 778c45f2c..b1fd9be4e 100644 --- a/mpfr/tests/tasin.c +++ b/mpfr/tests/tasin.c @@ -77,10 +77,10 @@ main (void) mpfr_print_rnd_mode (rnd)); printf (" got "); mpfr_out_str (stdout, 2, prec, z, GMP_RNDN); - putchar ('\n'); + puts (""); printf (" expected "); mpfr_out_str (stdout, 2, prec, y, GMP_RNDN); - putchar ('\n'); + puts (""); } } } diff --git a/mpfr/tests/tatan.c b/mpfr/tests/tatan.c index dbf0d4d2b..22f51e112 100644 --- a/mpfr/tests/tatan.c +++ b/mpfr/tests/tatan.c @@ -105,13 +105,13 @@ main (int argc, char *argv[]) mpfr_print_rnd_mode (rnd)); printf (" got "); mpfr_out_str (stdout, 2, prec, z, GMP_RNDN); - putchar ('\n'); + puts (""); printf (" expected "); mpfr_out_str (stdout, 2, prec, t, GMP_RNDN); - putchar ('\n'); + puts (""); printf (" approximation was "); mpfr_print_binary (y); - putchar ('\n'); + puts (""); exit (1); } } diff --git a/mpfr/tests/tcmp2.c b/mpfr/tests/tcmp2.c index e26f3b426..8e8adbffc 100644 --- a/mpfr/tests/tcmp2.c +++ b/mpfr/tests/tcmp2.c @@ -199,10 +199,10 @@ special (void) printf ("Error in mpfr_cmp2:\n"); printf ("x="); mpfr_print_binary (x); - putchar ('\n'); + puts (""); printf ("y="); mpfr_print_binary (y); - putchar ('\n'); + puts (""); printf ("got %lu, expected 1\n", j); exit (1); } @@ -213,8 +213,8 @@ special (void) j = 0; if (mpfr_cmp2(x, y, &j) <= 0 || j != 32) { printf("Error in mpfr_cmp2:\n"); - printf("x="); mpfr_print_binary(x); putchar('\n'); - printf("y="); mpfr_print_binary(y); putchar('\n'); + printf("x="); mpfr_print_binary(x); puts (""); + printf("y="); mpfr_print_binary(y); puts (""); printf("got %lu, expected 32\n", j); exit(1); } @@ -225,8 +225,8 @@ special (void) j = 0; if (mpfr_cmp2(x, y, &j) <= 0 || j != 164) { printf("Error in mpfr_cmp2:\n"); - printf("x="); mpfr_print_binary(x); putchar('\n'); - printf("y="); mpfr_print_binary(y); putchar('\n'); + printf("x="); mpfr_print_binary(x); puts (""); + printf("y="); mpfr_print_binary(y); puts (""); printf("got %lu, expected 164\n", j); exit(1); } @@ -238,8 +238,8 @@ special (void) j = 0; if (mpfr_cmp2(x, y, &j) <= 0 || j != 127) { printf("Error in mpfr_cmp2:\n"); - printf("x="); mpfr_print_binary(x); putchar('\n'); - printf("y="); mpfr_print_binary(y); putchar('\n'); + printf("x="); mpfr_print_binary(x); puts (""); + printf("y="); mpfr_print_binary(y); puts (""); printf("got %lu, expected 127\n", j); exit(1); } @@ -251,8 +251,8 @@ special (void) j = 0; if (mpfr_cmp2(x, y, &j) <= 0 || j != 63) { printf("Error in mpfr_cmp2:\n"); - printf("x="); mpfr_print_binary(x); putchar('\n'); - printf("y="); mpfr_print_binary(y); putchar('\n'); + printf("x="); mpfr_print_binary(x); puts (""); + printf("y="); mpfr_print_binary(y); puts (""); printf("got %lu, expected 63\n", j); exit(1); } @@ -264,8 +264,8 @@ special (void) j = 0; if (mpfr_cmp2(x, y, &j) <= 0 || j != 63) { printf("Error in mpfr_cmp2:\n"); - printf("x="); mpfr_print_binary(x); putchar('\n'); - printf("y="); mpfr_print_binary(y); putchar('\n'); + printf("x="); mpfr_print_binary(x); puts (""); + printf("y="); mpfr_print_binary(y); puts (""); printf("got %lu, expected 63\n", j); exit(1); } diff --git a/mpfr/tests/tconst_euler.c b/mpfr/tests/tconst_euler.c index a86b1154d..8dd947f8e 100644 --- a/mpfr/tests/tconst_euler.c +++ b/mpfr/tests/tconst_euler.c @@ -42,7 +42,7 @@ main (int argc, char *argv[]) mpfr_init2 (gamma, prec); mpfr_const_euler (gamma, GMP_RNDN); printf("gamma="); mpfr_out_str (stdout, 10, 0, gamma, GMP_RNDD); - putchar ('\n'); + puts (""); mpfr_clear (gamma); return 0; } @@ -72,13 +72,13 @@ main (int argc, char *argv[]) mpfr_print_rnd_mode (rnd)); printf (" got "); mpfr_out_str (stdout, 2, prec, z, GMP_RNDN); - putchar ('\n'); + puts (""); printf (" expected "); mpfr_out_str (stdout, 2, prec, t, GMP_RNDN); - putchar ('\n'); + puts (""); printf (" approximation was "); mpfr_print_binary (y); - putchar ('\n'); + puts (""); exit (1); } } diff --git a/mpfr/tests/tconst_log2.c b/mpfr/tests/tconst_log2.c index 47840cb9d..587f59867 100644 --- a/mpfr/tests/tconst_log2.c +++ b/mpfr/tests/tconst_log2.c @@ -101,7 +101,7 @@ main (int argc, char *argv[]) mpfr_const_log2 (x, rnd); printf ("log(2)="); mpfr_out_str (stdout, 10, 0, x, rnd); - putchar('\n'); + puts (""); } mpfr_set_prec (x, 53); diff --git a/mpfr/tests/tconst_pi.c b/mpfr/tests/tconst_pi.c index 245f1455e..54ccb6dc6 100644 --- a/mpfr/tests/tconst_pi.c +++ b/mpfr/tests/tconst_pi.c @@ -54,7 +54,7 @@ main (int argc, char *argv[]) { printf ("Pi="); mpfr_out_str (stdout, 10, 0, x, rnd); - putchar ('\n'); + puts (""); } } else if (mpfr_get_d1 (x) != 3.141592653589793116) diff --git a/mpfr/tests/tcos.c b/mpfr/tests/tcos.c index 8be61672e..866454815 100644 --- a/mpfr/tests/tcos.c +++ b/mpfr/tests/tcos.c @@ -111,8 +111,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_binary (x); putchar ('\n'); - printf (" got "); mpfr_print_binary (y); putchar ('\n'); + printf ("expected "); mpfr_print_binary (x); puts (""); + printf (" got "); mpfr_print_binary (y); puts (""); exit (1); } @@ -124,8 +124,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_binary (x); putchar ('\n'); - printf (" got "); mpfr_print_binary (y); putchar ('\n'); + printf ("expected "); mpfr_print_binary (x); puts (""); + printf (" got "); mpfr_print_binary (y); puts (""); exit (1); } @@ -137,7 +137,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_binary (y); putchar ('\n'); + printf ("expected 1.1100e-1, got "); mpfr_print_binary (y); puts (""); exit (1); } diff --git a/mpfr/tests/tdiv.c b/mpfr/tests/tdiv.c index 9ceb89981..6355c449a 100644 --- a/mpfr/tests/tdiv.c +++ b/mpfr/tests/tdiv.c @@ -143,8 +143,8 @@ check_convergence (void) 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_binary(x); putchar('\n'); - printf("instead of "); mpfr_print_binary(y); putchar('\n'); + printf("got "); mpfr_print_binary(x); puts (""); + printf("instead of "); mpfr_print_binary(y); puts (""); exit(1); } @@ -158,7 +158,7 @@ check_convergence (void) 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_binary(y); putchar('\n'); + printf("got "); mpfr_print_binary(y); puts (""); exit(1); } } @@ -192,8 +192,8 @@ check_lowr (void) { fprintf(stderr, "Error in mpfr_div rnd=GMP_RNDN\n"); printf("Dividing "); - printf("got "); mpfr_print_binary(z2); putchar('\n'); - printf("instead of "); mpfr_print_binary(z); putchar('\n'); + printf("got "); mpfr_print_binary(z2); puts (""); + printf("instead of "); mpfr_print_binary(z); puts (""); printf("inex flag = %d\n", c); exit(1); } @@ -211,8 +211,8 @@ check_lowr (void) { fprintf(stderr, "Error in mpfr_div rnd=GMP_RNDN\n"); printf("Dividing "); - printf("got "); mpfr_print_binary(z2); putchar('\n'); - printf("instead of "); mpfr_print_binary(z); putchar('\n'); + printf("got "); mpfr_print_binary(z2); puts (""); + printf("instead of "); mpfr_print_binary(z); puts (""); printf("inex flag = %d\n", c); exit(1); } @@ -223,8 +223,8 @@ check_lowr (void) { fprintf(stderr, "Error in mpfr_div [even rnd?] rnd=GMP_RNDN\n"); printf("Dividing "); - printf("got "); mpfr_print_binary(z2); putchar('\n'); - printf("instead of "); mpfr_print_binary(z); putchar('\n'); + printf("got "); mpfr_print_binary(z2); puts (""); + printf("instead of "); mpfr_print_binary(z); puts (""); printf("inex flag = %d\n", 1); exit(1); } @@ -236,8 +236,8 @@ check_lowr (void) { fprintf(stderr, "Error in mpfr_div [even rnd?] rnd=GMP_RNDN\n"); printf("Dividing "); - printf("got "); mpfr_print_binary(z2); putchar('\n'); - printf("instead of "); mpfr_print_binary(z); putchar('\n'); + printf("got "); mpfr_print_binary(z2); puts (""); + printf("instead of "); mpfr_print_binary(z); puts (""); printf("inex flag = %d\n", 1); exit(1); } @@ -267,8 +267,8 @@ check_lowr (void) if (c != -1 || mpfr_cmp(z2, z)) { fprintf(stderr, "Error in mpfr_div rnd=GMP_RNDD\n"); - printf("got "); mpfr_print_binary(z2); putchar('\n'); - printf("instead of "); mpfr_print_binary(z); putchar('\n'); + printf("got "); mpfr_print_binary(z2); puts (""); + printf("instead of "); mpfr_print_binary(z); puts (""); printf("inex flag = %d\n", c); exit(1); } @@ -280,8 +280,8 @@ check_lowr (void) if (c != 1 || mpfr_cmp(z2, z)) { fprintf(stderr, "Error in mpfr_div rnd=GMP_RNDU\n"); - printf("got "); mpfr_print_binary(z2); putchar('\n'); - printf("instead of "); mpfr_print_binary(z); putchar('\n'); + printf("got "); mpfr_print_binary(z2); puts (""); + printf("instead of "); mpfr_print_binary(z); puts (""); printf("inex flag = %d\n", c); exit(1); } @@ -331,7 +331,7 @@ check_inexact (void) { fprintf (stderr, "Wrong inexact flag (1): expected 1, got %d\n", inexact); - mpfr_print_binary(y); putchar('\n'); + mpfr_print_binary(y); puts (""); exit (1); } @@ -363,10 +363,10 @@ check_inexact (void) 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_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'); + printf ("x="); mpfr_print_binary (x); puts (""); + printf ("u="); mpfr_print_binary (u); puts (""); + printf ("y="); mpfr_print_binary (y); puts (""); + printf ("y*u="); mpfr_print_binary (z); puts (""); exit (1); } } diff --git a/mpfr/tests/tdiv_ui.c b/mpfr/tests/tdiv_ui.c index 5a30e779e..ad0bfae2d 100644 --- a/mpfr/tests/tdiv_ui.c +++ b/mpfr/tests/tdiv_ui.c @@ -104,8 +104,8 @@ special (void) if (mpfr_get_d1 (x) != mpfr_get_d1 (y)) { fprintf (stderr, "division by 1.0 fails for xprec=%u, yprec=%u\n", xprec, yprec); - printf ("expected "); mpfr_print_binary (x); putchar ('\n'); - printf ("got "); mpfr_print_binary (y); putchar ('\n'); + printf ("expected "); mpfr_print_binary (x); puts (""); + printf ("got "); mpfr_print_binary (y); puts (""); exit (1); } } @@ -143,8 +143,8 @@ check_inexact (void) 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_binary (y); putchar ('\n'); - printf ("z="); mpfr_print_binary (z); putchar ('\n'); + printf ("y="); mpfr_print_binary (y); puts (""); + printf ("z="); mpfr_print_binary (z); puts (""); exit (1); } cmp = mpfr_cmp (z, x); @@ -154,8 +154,8 @@ check_inexact (void) { fprintf (stderr, "Wrong inexact flag for u=%lu, rnd=%s\n", u, mpfr_print_rnd_mode(rnd)); - printf ("x="); mpfr_print_binary (x); putchar ('\n'); - printf ("y="); mpfr_print_binary (y); putchar ('\n'); + printf ("x="); mpfr_print_binary (x); puts (""); + printf ("y="); mpfr_print_binary (y); puts (""); exit (1); } } diff --git a/mpfr/tests/texceptions.c b/mpfr/tests/texceptions.c index 7f2fd829e..bfa18cc80 100644 --- a/mpfr/tests/texceptions.c +++ b/mpfr/tests/texceptions.c @@ -93,7 +93,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_binary (x); putchar ('\n'); + printf ("got "); mpfr_print_binary (x); puts (""); exit (1); } @@ -113,7 +113,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_binary (y); putchar ('\n'); + printf ("y="); mpfr_print_binary (y); puts (""); exit (1); } diff --git a/mpfr/tests/texp.c b/mpfr/tests/texp.c index bd8e8c544..dd71068ff 100644 --- a/mpfr/tests/texp.c +++ b/mpfr/tests/texp.c @@ -96,10 +96,10 @@ 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'); + puts (""); printf (" ="); mpfr_print_binary (y); - putchar ('\n'); + puts (""); if (n == 53) printf (" =%1.20e\n", mpfr_get_d1 (y)); @@ -200,13 +200,13 @@ compare_exp2_exp3 (int n) printf ("mpfr_exp_2 and mpfr_exp3 disagree for rnd=%s and\nx=", mpfr_print_rnd_mode (rnd)); mpfr_print_binary (x); - putchar ('\n'); + puts (""); printf ("mpfr_exp_2 gives "); mpfr_print_binary (y); - putchar ('\n'); + puts (""); printf ("mpfr_exp3 gives "); mpfr_print_binary (z); - putchar ('\n'); + puts (""); exit (1); } } diff --git a/mpfr/tests/tfactorial.c b/mpfr/tests/tfactorial.c index 712570a4a..7e368c4ec 100644 --- a/mpfr/tests/tfactorial.c +++ b/mpfr/tests/tfactorial.c @@ -87,7 +87,7 @@ main (int argc, char *argv[]) { fprintf (stderr, "Wrong inexact flag: expected inexact\n"); printf ("n=%u prec=%u\n", n, prec); - mpfr_print_binary(z); putchar('\n'); + mpfr_print_binary(z); puts (""); exit (1); } } @@ -99,13 +99,13 @@ main (int argc, char *argv[]) mpfr_print_rnd_mode (rnd)); printf (" got "); mpfr_out_str (stdout, 2, prec, z, GMP_RNDN); - putchar ('\n'); + puts (""); printf (" expected "); mpfr_out_str (stdout, 2, prec, t, GMP_RNDN); - putchar ('\n'); + puts (""); printf (" approximation was "); mpfr_print_binary (y); - putchar ('\n'); + puts (""); exit (1); } } diff --git a/mpfr/tests/tfma.c b/mpfr/tests/tfma.c index 4bbad6a35..d7f69bb1b 100644 --- a/mpfr/tests/tfma.c +++ b/mpfr/tests/tfma.c @@ -295,13 +295,13 @@ main (int argc, char *argv[]) mpfr_print_rnd_mode (rnd)); printf ("got "); mpfr_out_str (stdout, 2, prec, s, GMP_RNDN); - putchar ('\n'); + puts (""); printf ("expected "); mpfr_out_str (stdout, 2, prec, t, GMP_RNDN); - putchar ('\n'); + puts (""); printf ("approx "); mpfr_print_binary (slong); - putchar ('\n'); + puts (""); exit (1); } if (((inexact == 0) && (compare != 0)) || diff --git a/mpfr/tests/tgamma.c b/mpfr/tests/tgamma.c index 20cc6021c..584ec712e 100644 --- a/mpfr/tests/tgamma.c +++ b/mpfr/tests/tgamma.c @@ -88,10 +88,10 @@ main (void) mpfr_print_rnd_mode (rnd)); printf (" got "); mpfr_out_str (stdout, 2, prec, z, GMP_RNDN); - putchar ('\n'); + puts (""); printf (" expected "); mpfr_out_str (stdout, 2, prec, y, GMP_RNDN); - putchar ('\n'); + puts (""); } } } diff --git a/mpfr/tests/tgeneric.c b/mpfr/tests/tgeneric.c index 70a8a7903..4be686bcd 100644 --- a/mpfr/tests/tgeneric.c +++ b/mpfr/tests/tgeneric.c @@ -63,13 +63,13 @@ test_generic (int p0, int p1, int N) mpfr_print_rnd_mode (rnd)); printf ("got "); mpfr_out_str (stdout, 2, prec, z, GMP_RNDN); - putchar ('\n'); + puts (""); printf ("expected "); mpfr_out_str (stdout, 2, prec, t, GMP_RNDN); - putchar ('\n'); + puts (""); printf ("approx "); mpfr_print_binary (y); - putchar ('\n'); + puts (""); exit (1); } compare2 = mpfr_cmp (t, y); @@ -85,9 +85,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_binary (x); putchar ('\n'); - printf ("y="); mpfr_print_binary (y); putchar ('\n'); - printf ("t="); mpfr_print_binary (t); putchar ('\n'); + printf ("x="); mpfr_print_binary (x); puts (""); + printf ("y="); mpfr_print_binary (y); puts (""); + printf ("t="); mpfr_print_binary (t); puts (""); exit (1); } } diff --git a/mpfr/tests/tget_str.c b/mpfr/tests/tget_str.c index 61e549866..4aa0ddd9a 100644 --- a/mpfr/tests/tget_str.c +++ b/mpfr/tests/tget_str.c @@ -155,7 +155,7 @@ check_small (void) { fprintf(stderr, "Error in mpfr_get_str: 688 printed up to 4 bits should give 1.011e9\ninstead of "); mpfr_out_str (stderr, 2, 4, x, GMP_RNDU); - putchar ('\n'); + puts (""); exit (1); } (*__gmp_free_func) (s, strlen (s) + 1); diff --git a/mpfr/tests/thyperbolic.c b/mpfr/tests/thyperbolic.c index 2e2a8208b..33832c219 100644 --- a/mpfr/tests/thyperbolic.c +++ b/mpfr/tests/thyperbolic.c @@ -548,10 +548,10 @@ check_O (void) /* mpfr_out_str(stdout, 2,40,th,GMP_RNDN); - putchar('\n'); + puts (""); mpfr_out_str(stdout, 2,40,ath,GMP_RNDU); - putchar('\n'); + puts (""); */ if(mpfr_cmp_ui(ath,2)!=0) diff --git a/mpfr/tests/thypot.c b/mpfr/tests/thypot.c index 55b0146ed..5caadd6ff 100644 --- a/mpfr/tests/thypot.c +++ b/mpfr/tests/thypot.c @@ -131,13 +131,13 @@ main (int argc, char *argv[]) mpfr_print_rnd_mode (rnd)); printf (" got "); mpfr_out_str (stdout, 2, prec, z, GMP_RNDN); - putchar ('\n'); + puts (""); printf (" expected "); mpfr_out_str (stdout, 2, prec, t, GMP_RNDN); - putchar ('\n'); + puts (""); printf (" approximation was "); mpfr_print_binary (y); - putchar ('\n'); + puts (""); exit (1); } compare2 = mpfr_cmp (t, y); @@ -153,9 +153,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_binary (x1); putchar ('\n'); - printf ("x2="); mpfr_print_binary (x2); putchar ('\n'); - printf ("t="); mpfr_print_binary (t); putchar ('\n'); + printf ("x1="); mpfr_print_binary (x1); puts (""); + printf ("x2="); mpfr_print_binary (x2); puts (""); + printf ("t="); mpfr_print_binary (t); puts (""); exit (1); } } diff --git a/mpfr/tests/tlog.c b/mpfr/tests/tlog.c index 92deb86fc..d7b89eb14 100644 --- a/mpfr/tests/tlog.c +++ b/mpfr/tests/tlog.c @@ -90,8 +90,8 @@ check3 (double d, unsigned long prec, mp_rnd_t rnd) mpfr_init2(x, prec); mpfr_init2(y, prec); mpfr_set_d(x, d, rnd); mpfr_log(y, x, rnd); - mpfr_out_str(stdout, 10, 0, y, rnd); putchar('\n'); - mpfr_print_binary(y); putchar('\n'); + mpfr_out_str(stdout, 10, 0, y, rnd); puts (""); + mpfr_print_binary(y); puts (""); mpfr_clear(x); mpfr_clear(y); } diff --git a/mpfr/tests/tmul_ui.c b/mpfr/tests/tmul_ui.c index aaeaf952a..fd6e08e19 100644 --- a/mpfr/tests/tmul_ui.c +++ b/mpfr/tests/tmul_ui.c @@ -103,8 +103,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_binary (y); putchar ('\n'); - printf ("1*y="); mpfr_print_binary (x); putchar ('\n'); + printf ("y= "); mpfr_print_binary (y); puts (""); + printf ("1*y="); mpfr_print_binary (x); puts (""); exit (1); } @@ -147,7 +147,7 @@ main (int argc, char *argv[]) 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_binary(x); putchar('\n'); + mpfr_print_binary(x); puts (""); printf("mpfr_cmp_ui(x, 0) = %d\n", mpfr_cmp_ui(x, 0)); exit(1); } @@ -160,7 +160,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_binary (x); putchar ('\n'); + printf ("got "); mpfr_print_binary (x); puts (""); exit(1); } @@ -174,7 +174,7 @@ main (int argc, char *argv[]) if (mpfr_cmp(x, y)) { printf("Error for 121*y: expected result is:\n"); - mpfr_print_binary(y); putchar('\n'); + mpfr_print_binary(y); puts (""); } mpfr_set_prec (x, 32); @@ -201,8 +201,8 @@ main (int argc, char *argv[]) if (mpfr_cmp (x, y)) { printf ("Error for 23 * 2143861251406875.0\n"); - printf ("expected "); mpfr_print_binary (x); putchar ('\n'); - printf ("got "); mpfr_print_binary (y); putchar ('\n'); + printf ("expected "); mpfr_print_binary (x); puts (""); + printf ("got "); mpfr_print_binary (y); puts (""); exit (1); } @@ -218,8 +218,8 @@ main (int argc, char *argv[]) if (mpfr_get_d1 (x) != mpfr_get_d1 (y)) { fprintf (stderr, "multiplication by 1.0 fails for xprec=%u, yprec=%u\n", xprec, yprec); - printf ("expected "); mpfr_print_binary (x); putchar ('\n'); - printf ("got "); mpfr_print_binary (y); putchar ('\n'); + printf ("expected "); mpfr_print_binary (x); puts (""); + printf ("got "); mpfr_print_binary (y); puts (""); exit (1); } } diff --git a/mpfr/tests/tpow.c b/mpfr/tests/tpow.c index a824bf545..d94af9dc4 100644 --- a/mpfr/tests/tpow.c +++ b/mpfr/tests/tpow.c @@ -98,10 +98,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_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'); + printf ("x="); mpfr_print_binary (x); puts (""); + printf ("y="); mpfr_print_binary (y); puts (""); + printf ("t="); mpfr_print_binary (t); puts (""); + printf ("z="); mpfr_print_binary (z); puts (""); exit (1); } if (((inexact == 0) && (cmp != 0)) || @@ -110,8 +110,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_binary (x); putchar ('\n'); - printf ("y="); mpfr_print_binary (y); putchar ('\n'); + printf ("u=%lu x=", u); mpfr_print_binary (x); puts (""); + printf ("y="); mpfr_print_binary (y); puts (""); exit (1); } } diff --git a/mpfr/tests/tpow3.c b/mpfr/tests/tpow3.c index e4964753a..8cf2dffc5 100644 --- a/mpfr/tests/tpow3.c +++ b/mpfr/tests/tpow3.c @@ -89,13 +89,13 @@ main (int argc, char *argv[]) mpfr_print_rnd_mode (rnd)); printf ("got "); mpfr_out_str (stdout, 2, prec, z, GMP_RNDN); - putchar ('\n'); + puts (""); printf ("expected "); mpfr_out_str (stdout, 2, prec, t, GMP_RNDN); - putchar ('\n'); + puts (""); printf ("approx "); mpfr_print_binary (y); - putchar ('\n'); + puts (""); exit (1); } compare2 = mpfr_cmp (t, y); @@ -111,9 +111,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_binary (x); putchar ('\n'); - printf ("y="); mpfr_print_binary (y); putchar ('\n'); - printf ("t="); mpfr_print_binary (t); putchar ('\n'); + printf ("x="); mpfr_print_binary (x); puts (""); + printf ("y="); mpfr_print_binary (y); puts (""); + printf ("t="); mpfr_print_binary (t); puts (""); exit (1); } } diff --git a/mpfr/tests/trandom.c b/mpfr/tests/trandom.c index 933f8524c..3c512c59e 100644 --- a/mpfr/tests/trandom.c +++ b/mpfr/tests/trandom.c @@ -104,14 +104,14 @@ test_random2 (unsigned long nbtests, unsigned long prec, int verbose) if (MPFR_MANT(x)[0] & ((MP_LIMB_T_ONE << sh) - MP_LIMB_T_ONE)) { fprintf (stderr, "Error: mpfr_random2() returns invalid numbers:\n"); - mpfr_print_binary (x); putchar ('\n'); + mpfr_print_binary (x); puts (""); exit (1); } /* check that exponent is in correct range */ if (mpfr_get_exp (x) != 0) { fprintf (stderr, "Error: mpfr_random2 (.., .., 0) does not return a 0 exponent:\n"); - mpfr_print_binary (x); putchar ('\n'); + mpfr_print_binary (x); puts (""); exit (1); } d = mpfr_get_d1 (x); av += d; var += d*d; @@ -175,7 +175,7 @@ test_urandomb (unsigned long nbtests, unsigned long prec, int verbose) if (MPFR_MANT(x)[0] & ((MP_LIMB_T_ONE << sh) - MP_LIMB_T_ONE)) { fprintf (stderr, "Error: mpfr_urandomb() returns invalid numbers:\n"); - mpfr_print_binary (x); putchar ('\n'); + mpfr_print_binary (x); puts (""); exit (1); } d = mpfr_get_d1 (x); av += d; var += d*d; diff --git a/mpfr/tests/tset_d.c b/mpfr/tests/tset_d.c index 2b3c4578b..84a9e922d 100644 --- a/mpfr/tests/tset_d.c +++ b/mpfr/tests/tset_d.c @@ -51,7 +51,7 @@ main (int argc, char *argv[]) fprintf (stderr, "got "); mpfr_out_str (stderr, 10, 10, x, GMP_RNDN); fprintf (stderr, "\n"); - mpfr_print_binary (x); putchar ('\n'); + mpfr_print_binary (x); puts (""); exit (1); } } @@ -84,13 +84,13 @@ main (int argc, char *argv[]) mpfr_init2(z, 32); mpfr_set_d(z, 1.0, 0); if (mpfr_get_d1 (z) != 1.0) { - mpfr_print_binary(z); putchar('\n'); + mpfr_print_binary(z); puts (""); 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_d1 (x) != d) { - mpfr_print_binary(x); putchar('\n'); + mpfr_print_binary(x); puts (""); printf("Error: get_d o set_d <> identity for d = %1.20e %1.20e\n",d, mpfr_get_d1 (x)); exit(1); } @@ -100,7 +100,7 @@ main (int argc, char *argv[]) d = -6.72658901114033715233e-165; mpfr_set_d(x, d, 0); if (d != mpfr_get_d1 (x)) { - mpfr_print_binary(x); putchar('\n'); + mpfr_print_binary(x); puts (""); printf("Error: get_d o set_d <> identity for d = %1.20e %1.20e\n",d, mpfr_get_d1 (x)); exit(1); } @@ -123,7 +123,7 @@ main (int argc, char *argv[]) fprintf (stderr, "Mismatch on : %1.18g != %1.18g\n", d, mpfr_get_d1 (x)); mpfr_print_binary (x); - putchar ('\n'); + puts (""); exit (1); } } diff --git a/mpfr/tests/tset_si.c b/mpfr/tests/tset_si.c index 8a0c62a7a..36771751c 100644 --- a/mpfr/tests/tset_si.c +++ b/mpfr/tests/tset_si.c @@ -97,7 +97,7 @@ main (int argc, char *argv[]) || inex >= 0) { fprintf(stderr, "Error in mpfr_set_si(x:3, 77617, GMP_RNDD)\n"); - mpfr_print_binary(x); putchar('\n'); + mpfr_print_binary(x); puts (""); exit(1); } inex = mpfr_set_ui(x, 77617, GMP_RNDD); /* should be 65536 */ @@ -105,7 +105,7 @@ main (int argc, char *argv[]) || inex >= 0) { fprintf(stderr, "Error in mpfr_set_ui(x:3, 77617, GMP_RNDD)\n"); - mpfr_print_binary(x); putchar('\n'); + mpfr_print_binary(x); puts (""); exit(1); } diff --git a/mpfr/tests/tset_str.c b/mpfr/tests/tset_str.c index 1eb550908..e200c18a4 100644 --- a/mpfr/tests/tset_str.c +++ b/mpfr/tests/tset_str.c @@ -46,7 +46,7 @@ main (int argc, char *argv[]) mpfr_init2 (x, prec); mpfr_set_str_raw (x, argv[1]); mpfr_out_str (stdout, 10, 0, x, GMP_RNDN); - putchar ('\n'); + puts (""); mpfr_clear (x); return 0; } @@ -91,9 +91,9 @@ main (int argc, char *argv[]) { fprintf (stderr, "Error in mpfr_set_str (1a):\n"); mpfr_print_binary (x); - putchar ('\n'); + puts (""); mpfr_print_binary (y); - putchar ('\n'); + puts (""); mpfr_clear (x); mpfr_clear (y); exit (1); @@ -105,9 +105,9 @@ main (int argc, char *argv[]) { fprintf (stderr, "Error in mpfr_set_str (1b):\n"); mpfr_print_binary (x); - putchar ('\n'); + puts (""); mpfr_print_binary (y); - putchar ('\n'); + puts (""); mpfr_clear (x); mpfr_clear (y); exit (1); @@ -171,11 +171,11 @@ main (int argc, char *argv[]) mpfr_print_rnd_mode (k)); printf ("x="); mpfr_print_binary (x); - putchar('\n'); + puts (""); printf ("s=%s, exp=%d, base=%d\n", str, (int) e, base); printf ("y="); mpfr_print_binary (y); - putchar('\n'); + puts (""); mpfr_clear (x); mpfr_clear (y); exit (1); @@ -230,9 +230,9 @@ main (int argc, char *argv[]) { fprintf (stderr, "Error in mpfr_set_str (2):\n"); mpfr_print_binary (x); - putchar ('\n'); + puts (""); mpfr_print_binary (y); - putchar ('\n'); + puts (""); mpfr_clear (x); mpfr_clear (y); exit (1); @@ -251,9 +251,9 @@ main (int argc, char *argv[]) { fprintf (stderr, "Error in mpfr_set_str (3):\n"); mpfr_print_binary (x); - putchar ('\n'); + puts (""); mpfr_print_binary (y); - putchar ('\n'); + puts (""); mpfr_clear (x); mpfr_clear (y); exit (1); @@ -275,9 +275,9 @@ main (int argc, char *argv[]) { fprintf (stderr, "Error in mpfr_set_str (4):\n"); mpfr_print_binary (x); - putchar ('\n'); + puts (""); mpfr_print_binary (y); - putchar ('\n'); + puts (""); mpfr_clear (x); mpfr_clear (y); exit (1); @@ -294,9 +294,9 @@ main (int argc, char *argv[]) { fprintf (stderr, "Error in mpfr_set_str (5):\n"); mpfr_print_binary (x); - putchar ('\n'); + puts (""); mpfr_print_binary (y); - putchar ('\n'); + puts (""); mpfr_clear (x); mpfr_clear (y); exit (1); @@ -311,9 +311,9 @@ main (int argc, char *argv[]) { fprintf (stderr, "Error in mpfr_set_str (6):\n"); mpfr_print_binary (x); - putchar ('\n'); + puts (""); mpfr_print_binary (y); - putchar ('\n'); + puts (""); mpfr_clear (x); mpfr_clear (y); exit (1); @@ -328,9 +328,9 @@ main (int argc, char *argv[]) { fprintf (stderr, "Error in mpfr_set_str (7):\n"); mpfr_print_binary (x); - putchar ('\n'); + puts (""); mpfr_print_binary (y); - putchar ('\n'); + puts (""); mpfr_clear (x); mpfr_clear (y); exit (1); @@ -368,14 +368,10 @@ main (int argc, char *argv[]) mpfr_get_str (str + 2, &exp, base[cbase], nb_digit, x, rnd[crnd]); - if (str[2] == '-') - { - str[0] = '-'; str[1] = '0'; str[2] = '.'; - } - else - { - str[0] = '0'; str[1] = '.'; - } + str[0] = '-'; + str[(str[2] == '-')] = '0'; + str[(str[2] == '-') + 1] = '.'; + for (str1 = str; *str1 != 0; str1++); sprintf (str1, "@%i", (int) exp); @@ -386,10 +382,10 @@ main (int argc, char *argv[]) fprintf (stderr, "Error in mpfr_set_str for nb_digit=%u, base=%u, rnd=%s:\n", nb_digit, base[cbase], mpfr_print_rnd_mode (rnd[crnd])); fprintf (stderr, "instead of: "); mpfr_print_binary (x); - putchar ('\n'); + puts (""); fprintf (stderr, "return : "); mpfr_print_binary (y); - putchar ('\n'); + puts (""); } } diff --git a/mpfr/tests/tsin_cos.c b/mpfr/tests/tsin_cos.c index e6fd5e6b2..8b4d48a4c 100644 --- a/mpfr/tests/tsin_cos.c +++ b/mpfr/tests/tsin_cos.c @@ -39,7 +39,7 @@ large_test (int prec, int N) mpfr_set_d (x, 3.0, GMP_RNDN); mpfr_sqrt (x, x, GMP_RNDN); for (i=0; i<N; i++) mpfr_sin_cos (s, c, x, GMP_RNDN); - mpfr_out_str (stdout, 10, 0, s, GMP_RNDN); putchar('\n'); + mpfr_out_str (stdout, 10, 0, s, GMP_RNDN); puts (""); mpfr_clear (x); mpfr_clear (s); mpfr_clear (c); diff --git a/mpfr/tests/tsqrt.c b/mpfr/tests/tsqrt.c index 5ae89e7ab..bd161faa3 100644 --- a/mpfr/tests/tsqrt.c +++ b/mpfr/tests/tsqrt.c @@ -68,8 +68,8 @@ check4 (double a, mp_rnd_t rnd_mode, char *Q) { printf("mpfr_sqrt failed for a=%1.20e, rnd_mode=%s\n", a, mpfr_print_rnd_mode(rnd_mode)); - printf("expected "); mpfr_print_binary(res); putchar('\n'); - printf("got "); mpfr_print_binary(q); putchar('\n'); + printf("expected "); mpfr_print_binary(res); puts (""); + printf("got "); mpfr_print_binary(q); puts (""); mpfr_clear(q); mpfr_clear(res); exit(1); } @@ -175,7 +175,7 @@ special (void) if (mpfr_get_d1 (x) != 1.5) { fprintf (stderr, "Error: sqrt(1+ulp(1), up) should give 1.5 (prec=%u)\n", (unsigned) p); - printf ("got "); mpfr_print_binary (x); putchar ('\n'); + printf ("got "); mpfr_print_binary (x); puts (""); exit (1); } } @@ -243,7 +243,7 @@ check_inexact (mp_prec_t p) printf ("x="); mpfr_print_binary (x); printf (" rnd=%s\n", mpfr_print_rnd_mode (rnd)); - printf ("y="); mpfr_print_binary (y); putchar ('\n'); + printf ("y="); mpfr_print_binary (y); puts (""); exit (1); } mpfr_clear (x); diff --git a/mpfr/tests/tsub.c b/mpfr/tests/tsub.c index 27b0acafb..ffff6e901 100644 --- a/mpfr/tests/tsub.c +++ b/mpfr/tests/tsub.c @@ -47,8 +47,8 @@ check_diverse (void) if (mpfr_cmp (z, y)) { fprintf (stderr, "Error in mpfr_sub (5)\n"); - printf ("expected "); mpfr_print_binary (y); putchar ('\n'); - printf ("got "); mpfr_print_binary (z); putchar ('\n'); + printf ("expected "); mpfr_print_binary (y); puts (""); + printf ("got "); mpfr_print_binary (z); puts (""); exit (1); } @@ -60,8 +60,8 @@ check_diverse (void) if (mpfr_cmp (z, y)) { fprintf (stderr, "Error in mpfr_sub (7)\n"); - printf ("expected "); mpfr_print_binary (y); putchar ('\n'); - printf ("got "); mpfr_print_binary (z); putchar ('\n'); + printf ("expected "); mpfr_print_binary (y); puts (""); + printf ("got "); mpfr_print_binary (z); puts (""); exit (1); } @@ -73,8 +73,8 @@ check_diverse (void) if (mpfr_cmp (z, y)) { fprintf (stderr, "Error in mpfr_sub (6)\n"); - printf ("expected "); mpfr_print_binary (y); putchar ('\n'); - printf ("got "); mpfr_print_binary (z); putchar ('\n'); + printf ("expected "); mpfr_print_binary (y); puts (""); + printf ("got "); mpfr_print_binary (z); puts (""); exit (1); } @@ -109,8 +109,8 @@ check_diverse (void) if (mpfr_cmp (x, y)) { fprintf (stderr, "Error in mpfr_sub (1 - 1E-33) with prec=33\n"); - printf ("Expected "); mpfr_print_binary (y); putchar ('\n'); - printf ("got "); mpfr_print_binary (x); putchar ('\n'); + printf ("Expected "); mpfr_print_binary (y); puts (""); + printf ("got "); mpfr_print_binary (x); puts (""); exit (1); } @@ -122,7 +122,7 @@ check_diverse (void) 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_binary (x); putchar ('\n'); + printf ("Expected 1.0, got "); mpfr_print_binary (x); puts (""); exit (1); } @@ -192,8 +192,8 @@ check_diverse (void) 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_binary (x); putchar('\n'); - printf ("got "); mpfr_print_binary (z); putchar('\n'); + printf ("expected "); mpfr_print_binary (x); puts (""); + printf ("got "); mpfr_print_binary (z); puts (""); exit (1); } @@ -270,8 +270,8 @@ bug_ddefour(void) if (mpfr_cmp(ex2, ex3)) { fprintf (stderr, "Error in ddefour test.\n"); - printf ("ex2="); mpfr_print_binary (ex2); putchar ('\n'); - printf ("ex3="); mpfr_print_binary (ex3); putchar ('\n'); + printf ("ex2="); mpfr_print_binary (ex2); puts (""); + printf ("ex3="); mpfr_print_binary (ex3); puts (""); exit (1); } @@ -312,11 +312,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_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 ("x="); mpfr_print_binary(x); puts (""); + printf ("y="); mpfr_print_binary(y); puts (""); + printf ("u="); mpfr_print_binary(u); puts (""); + printf ("v="); mpfr_print_binary(v); puts (""); + printf ("w="); mpfr_print_binary(w); puts (""); printf ("inexact = %d\n", inexact); exit (1); } @@ -387,10 +387,10 @@ check_inexact (void) 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_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'); + printf ("x="); mpfr_print_binary (x); puts (""); + printf ("u="); mpfr_print_binary (u); puts (""); + printf ("y= "); mpfr_print_binary (y); puts (""); + printf ("x-u="); mpfr_print_binary (z); puts (""); exit (1); } } diff --git a/mpfr/tests/tsub_ui.c b/mpfr/tests/tsub_ui.c index c6e7e5998..532817c13 100644 --- a/mpfr/tests/tsub_ui.c +++ b/mpfr/tests/tsub_ui.c @@ -91,10 +91,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_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 ("y="); mpfr_print_binary(y); puts (""); + printf ("u="); mpfr_print_binary(u); puts (""); + printf ("v="); mpfr_print_binary(v); puts (""); + printf ("w="); mpfr_print_binary(w); puts (""); printf ("inexact = %d\n", inexact); exit (1); } diff --git a/mpfr/tests/tui_div.c b/mpfr/tests/tui_div.c index 773638689..deacaf669 100644 --- a/mpfr/tests/tui_div.c +++ b/mpfr/tests/tui_div.c @@ -90,9 +90,9 @@ check_inexact (void) 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_binary (x); putchar ('\n'); - printf ("y="); mpfr_print_binary (y); putchar ('\n'); - printf ("y*x="); mpfr_print_binary (z); putchar ('\n'); + printf ("x="); mpfr_print_binary (x); puts (""); + printf ("y="); mpfr_print_binary (y); puts (""); + printf ("y*x="); mpfr_print_binary (z); puts (""); exit (1); } } diff --git a/mpfr/tests/tui_pow.c b/mpfr/tests/tui_pow.c index fbde84e2f..35b836506 100644 --- a/mpfr/tests/tui_pow.c +++ b/mpfr/tests/tui_pow.c @@ -115,13 +115,13 @@ main (int argc, char *argv[]) mpfr_print_rnd_mode (rnd)); printf ("got "); mpfr_out_str (stdout, 2, prec, z, GMP_RNDN); - putchar ('\n'); + puts (""); printf ("expected "); mpfr_out_str (stdout, 2, prec, t, GMP_RNDN); - putchar ('\n'); + puts (""); printf ("approx "); mpfr_print_binary (y); - putchar ('\n'); + puts (""); exit (1); } compare2 = mpfr_cmp (t, y); @@ -137,9 +137,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_binary (x); putchar ('\n'); - printf ("y="); mpfr_print_binary (y); putchar ('\n'); - printf ("t="); mpfr_print_binary (t); putchar ('\n'); + printf ("x="); mpfr_print_binary (x); puts (""); + printf ("y="); mpfr_print_binary (y); puts (""); + printf ("t="); mpfr_print_binary (t); puts (""); exit (1); } } diff --git a/mpfr/tests/tui_sub.c b/mpfr/tests/tui_sub.c index 9900bc253..231a228f5 100644 --- a/mpfr/tests/tui_sub.c +++ b/mpfr/tests/tui_sub.c @@ -182,10 +182,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_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 ("y="); mpfr_print_binary(y); puts (""); + printf ("u="); mpfr_print_binary(u); puts (""); + printf ("v="); mpfr_print_binary(v); puts (""); + printf ("w="); mpfr_print_binary(w); puts (""); printf ("inexact = %d\n", inexact); exit (1); } diff --git a/mpfr/tests/tzeta.c b/mpfr/tests/tzeta.c index 255066a79..52ded9827 100644 --- a/mpfr/tests/tzeta.c +++ b/mpfr/tests/tzeta.c @@ -72,10 +72,10 @@ test_generic () mpfr_print_rnd_mode (rnd)); printf (" got "); mpfr_out_str (stdout, 2, prec, z, GMP_RNDN); - putchar ('\n'); + puts (""); printf (" expected "); mpfr_out_str (stdout, 2, prec, y, GMP_RNDN); - putchar ('\n'); + puts (""); exit (1); } } |