summaryrefslogtreecommitdiff
path: root/tests/tbeta.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2017-02-28 11:11:29 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2017-02-28 11:11:29 +0000
commit07c43181a6a395e58d80d45afec0f34f9357668d (patch)
tree08b0cdbbe1f281fcb99cd3d4c354761e27cf1e1a /tests/tbeta.c
parent530ec015da43bb1a0f6360ac6a086057eb30abff (diff)
downloadmpfr-07c43181a6a395e58d80d45afec0f34f9357668d.tar.gz
[tests/tbeta.c] C89 compatibility and some code reformatting.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@11379 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tbeta.c')
-rw-r--r--tests/tbeta.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/tests/tbeta.c b/tests/tbeta.c
index 40f62b34a..832c2c730 100644
--- a/tests/tbeta.c
+++ b/tests/tbeta.c
@@ -58,9 +58,10 @@ not_same (mpfr_t a, mpfr_t b)
res = 1;
if (! mpfr_equal_p(a, b) && (! mpfr_nan_p(a) && ! mpfr_nan_p(b)))
res = 1;
- if ((! mpfr_signbit(a) != ! mpfr_signbit(b)) && ((! mpfr_nan_p(a) && ! mpfr_nan_p(b))))
+ if ((! mpfr_signbit(a) != ! mpfr_signbit(b)) &&
+ (! mpfr_nan_p(a) && ! mpfr_nan_p(b)))
res = 1;
-
+
return res;
}
@@ -191,12 +192,12 @@ Sage gives this as 0, and Lefevre said that we should return +0
static void
test_beta_zw_sum_int (mpfr_prec_t prec)
{
- if (prec < 4) {
- prec = 4;
- }
mpfr_t r, z, w, expect;
int sum;
+ if (prec < 4)
+ prec = 4;
+
mpfr_init2 (r, prec);
mpfr_init2 (z, prec);
mpfr_init2 (w, prec);
@@ -208,25 +209,23 @@ test_beta_zw_sum_int (mpfr_prec_t prec)
mpfr_set_zero (expect, 1);
TEST(prec, r, z, w, expect);
-
sum = -12;
mpfr_set_str (z, "-1.101e0", 2, MPFR_RNDN);
mpfr_si_sub (w, sum, z, MPFR_RNDN);
mpfr_set_zero (expect, 1);
TEST(prec, r, z, w, expect);
-
+
sum = -1;
mpfr_set_str (z, "-.11e0", 2, MPFR_RNDN);
mpfr_si_sub (w, sum, z, MPFR_RNDN);
mpfr_set_zero (expect, 1);
TEST(prec, r, z, w, expect);
-
+
sum = -13;
mpfr_set_str (z, "-.001e0", 2, MPFR_RNDN);
mpfr_si_sub (w, sum, z, MPFR_RNDN);
mpfr_set_zero (expect, 1);
TEST(prec, r, z, w, expect);
-
mpfr_clear (r);
mpfr_clear (z);
@@ -243,6 +242,7 @@ test_beta_hardcoded (mpfr_prec_t prec)
if (prec < 10)
prec = 10;
+
mpfr_init2 (z, prec);
mpfr_init2 (w, prec);
mpfr_init2 (r, oprec);
@@ -367,7 +367,6 @@ main (void)
test_beta_zw_sum_int (10);
test_beta_zw_sum_int (100);
-
test_generic (MPFR_PREC_MIN, 100, 20);