[Gmp-commit] /var/hg/gmp: 2 new changesets
mercurial at gmplib.org
mercurial at gmplib.org
Mon May 15 20:30:43 UTC 2017
details: /var/hg/gmp/rev/98722ebc8200
changeset: 17384:98722ebc8200
user: Torbjorn Granlund <tg at gmplib.org>
date: Tue May 09 12:06:39 2017 +0200
description:
Whitespace cleanup.
details: /var/hg/gmp/rev/7b2cf042a116
changeset: 17385:7b2cf042a116
user: Torbjorn Granlund <tg at gmplib.org>
date: Tue May 09 12:08:01 2017 +0200
description:
Whitespace-cleanup.
diffstat:
mini-gmp/tests/t-signed.c | 22 +++++++++++-----------
tests/mpz/t-primorial_ui.c | 26 +++++++++++++-------------
2 files changed, 24 insertions(+), 24 deletions(-)
diffs (118 lines):
diff -r 1c5099e4d6a0 -r 7b2cf042a116 mini-gmp/tests/t-signed.c
--- a/mini-gmp/tests/t-signed.c Thu May 04 12:58:27 2017 +0200
+++ b/mini-gmp/tests/t-signed.c Tue May 09 12:08:01 2017 +0200
@@ -24,7 +24,7 @@
#include "testutils.h"
/* Always called with sz fitting in a signed long, and si is the
- corresponding value. */
+ corresponding value. */
int
check_si (const mpz_t sz, long si)
{
@@ -56,7 +56,7 @@
}
/* Called with mpz_cmp (sz, oz) == c. If sz fits in a signed long,
- si is the coresponding value, and similarly for oz and oi. */
+ si is the coresponding value, and similarly for oz and oi. */
void
check_si_cmp (const mpz_t sz, const mpz_t oz, long si, long oi, int c)
{
@@ -89,7 +89,7 @@
goto fail;
}
}
- if (mpz_fits_slong_p (oz))
+ if (mpz_fits_slong_p (oz))
{
if (!check_si (oz, oi))
goto fail;
@@ -134,15 +134,15 @@
overflow_count++;
check_si_cmp (sz, oz, si, oi, c);
-
+
/* c * (2^k + 1) */
if (c == -1)
mpz_sub_ui (oz, sz, 1);
else
mpz_add_ui (oz, sz, 1);
if (mpz_fits_slong_p (oz))
- oi = si + c;
- else
+ oi = si + c;
+ else
overflow_count++;
check_si_cmp (oz, sz, oi, si, c);
@@ -153,18 +153,18 @@
else
mpz_sub_ui (oz, oz, 1); /* oz = sz * 2 - 1 */
if (mpz_fits_slong_p (oz))
- oi = (si - c) * 2 + c;
- else
+ oi = (si - c) * 2 + c;
+ else
overflow_count++;
-
+
check_si_cmp (oz, sz, oi, si, c);
};
-
+
mpz_clear (sz);
mpz_clear (oz);
}
-void
+void
try_fits_slong_p (void)
{
mpz_t x;
diff -r 1c5099e4d6a0 -r 7b2cf042a116 tests/mpz/t-primorial_ui.c
--- a/tests/mpz/t-primorial_ui.c Thu May 04 12:58:27 2017 +0200
+++ b/tests/mpz/t-primorial_ui.c Tue May 09 12:08:01 2017 +0200
@@ -61,12 +61,12 @@
MPZ_CHECK_FORMAT (r);
if (mpz_cmp (f, r) != 0)
- {
- printf ("mpz_primorial_ui(%lu) wrong\n", n);
- printf (" got "); mpz_out_str (stdout, 10, r); printf("\n");
- printf (" want "); mpz_out_str (stdout, 10, f); printf("\n");
- abort ();
- }
+ {
+ printf ("mpz_primorial_ui(%lu) wrong\n", n);
+ printf (" got "); mpz_out_str (stdout, 10, r); printf("\n");
+ printf (" want "); mpz_out_str (stdout, 10, f); printf("\n");
+ abort ();
+ }
if (isprime (++n))
mpz_mul_ui (f, f, n); /* p# = (p-1)# * (p) */
@@ -91,15 +91,15 @@
do {
if (isprime (++i))
mpz_mul_ui (f, f, i);
- } while (--d != 0);
+ } while (--d != 0);
if (mpz_cmp (f, r) != 0)
- {
- printf ("mpz_primorial_ui(%lu) wrong\n", i);
- printf (" got "); mpz_out_str (stdout, 10, r); printf("\n");
- printf (" want "); mpz_out_str (stdout, 10, f); printf("\n");
- abort ();
- }
+ {
+ printf ("mpz_primorial_ui(%lu) wrong\n", i);
+ printf (" got "); mpz_out_str (stdout, 10, r); printf("\n");
+ printf (" want "); mpz_out_str (stdout, 10, f); printf("\n");
+ abort ();
+ }
} while (++n < limit);
/* Chech a single "big" value, modulo a larger prime */
n = 2095637;
More information about the gmp-commit
mailing list