[Gmp-commit] /var/hg/gmp: 5 new changesets

mercurial at gmplib.org mercurial at gmplib.org
Fri May 18 10:23:08 CEST 2012


details:   /var/hg/gmp/rev/2a1e6258ef9b
changeset: 14978:2a1e6258ef9b
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Fri May 18 10:16:51 2012 +0200
description:
tests/mpf/t-set.c: use TESTS_REPS.

details:   /var/hg/gmp/rev/5708ad46b1e1
changeset: 14979:5708ad46b1e1
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Fri May 18 10:17:39 2012 +0200
description:
mpn/generic/mullo_n.c: Disable MAYBE_ if WANT_FAT_BINARY.

details:   /var/hg/gmp/rev/f712b39cf958
changeset: 14980:f712b39cf958
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Fri May 18 10:18:36 2012 +0200
description:
mpz/cmpabs_d.c: Remove an unused branch.

details:   /var/hg/gmp/rev/106372e5e048
changeset: 14981:106372e5e048
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Fri May 18 10:22:00 2012 +0200
description:
tests/mpz: slightly wider coverage.

details:   /var/hg/gmp/rev/456eabc04434
changeset: 14982:456eabc04434
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Fri May 18 10:23:00 2012 +0200
description:
Copyright year.

diffstat:

 ChangeLog                |   7 +++++++
 mpn/generic/mullo_n.c    |   2 +-
 mpz/cmpabs_d.c           |   2 +-
 tests/mpf/t-set.c        |   4 +---
 tests/mpz/t-cmp_d.c      |   7 +++++--
 tests/mpz/t-get_d_2exp.c |  29 ++++++++++++++++++++++++++++-
 tests/mpz/t-inp_str.c    |  19 +++++++++++++++----
 7 files changed, 58 insertions(+), 12 deletions(-)

diffs (175 lines):

diff -r dcc3d46fa395 -r 456eabc04434 ChangeLog
--- a/ChangeLog	Thu May 17 14:54:04 2012 +0200
+++ b/ChangeLog	Fri May 18 10:23:00 2012 +0200
@@ -8,6 +8,13 @@
 
 	* tests/cxx/t-ops.cc (check_mpq): Check squaring.
 	* tests/mpq/t-equal.c (check_various): Check different den-size.
+
+	* mpn/generic/mullo_n.c: Disable MAYBE_ if WANT_FAT_BINARY.
+	* mpz/cmpabs_d.c: Remove an unused branch.
+
+	* tests/mpz/t-get_d_2exp.c (check_zero): New check.
+	* tests/mpz/t-inp_str.c: A few more cases.
+	* tests/mpz/t-cmp_d.c: More bases and symbols, a few cases.
 	
 2012-05-16  Torbjorn Granlund  <tege at gmplib.org>
 
diff -r dcc3d46fa395 -r 456eabc04434 mpn/generic/mullo_n.c
--- a/mpn/generic/mullo_n.c	Thu May 17 14:54:04 2012 +0200
+++ b/mpn/generic/mullo_n.c	Fri May 18 10:23:00 2012 +0200
@@ -40,7 +40,7 @@
 #define MULLO_MUL_N_THRESHOLD MUL_FFT_THRESHOLD
 #endif
 
-#if TUNE_PROGRAM_BUILD
+#if TUNE_PROGRAM_BUILD || WANT_FAT_BINARY
 #define MAYBE_range_basecase 1
 #define MAYBE_range_toom22   1
 #else
diff -r dcc3d46fa395 -r 456eabc04434 mpz/cmpabs_d.c
--- a/mpz/cmpabs_d.c	Thu May 17 14:54:04 2012 +0200
+++ b/mpz/cmpabs_d.c	Fri May 18 10:23:00 2012 +0200
@@ -62,7 +62,7 @@
   if (d == 0.0)
     return (zsize != 0);
   if (zsize == 0)
-    return (d != 0 ? -1 : 0);
+    return -1; /* d != 0 */
 
   /* 2. Ignore signs. */
   zsize = ABS(zsize);
diff -r dcc3d46fa395 -r 456eabc04434 tests/mpf/t-set.c
--- a/tests/mpf/t-set.c	Thu May 17 14:54:04 2012 +0200
+++ b/tests/mpf/t-set.c	Fri May 18 10:23:00 2012 +0200
@@ -102,10 +102,8 @@
 {
   long reps = 10000;
 
-  if (argc == 2)
-    reps = strtol (argv[1], 0, 0);
-
   tests_start ();
+  TESTS_REPS (reps, argv, argc);
 
   check_reuse ();
   check_random (reps);
diff -r dcc3d46fa395 -r 456eabc04434 tests/mpz/t-cmp_d.c
--- a/tests/mpz/t-cmp_d.c	Thu May 17 14:54:04 2012 +0200
+++ b/tests/mpz/t-cmp_d.c	Fri May 18 10:23:00 2012 +0200
@@ -84,11 +84,14 @@
     {  "1",  0.0,  1,  1 },
     { "-1",  0.0, -1,  1 },
 
+    {  "1",  0.5,  1,  1 },
+    { "-1", -0.5, -1,  1 },
+
     {  "0",  1.0, -1, -1 },
     {  "0", -1.0,  1, -1 },
 
-    {  "0x1000000000000000000000000000000000000000000000000", 0.0,  1, 1 },
-    { "-0x1000000000000000000000000000000000000000000000000", 0.0, -1, 1 },
+    {  "0x1000000000000000000000000000000000000000000000000", 1.0,  1, 1 },
+    { "-0x1000000000000000000000000000000000000000000000000", 1.0, -1, 1 },
 
     {  "0",  1e100, -1, -1 },
     {  "0", -1e100,  1, -1 },
diff -r dcc3d46fa395 -r 456eabc04434 tests/mpz/t-get_d_2exp.c
--- a/tests/mpz/t-get_d_2exp.c	Thu May 17 14:54:04 2012 +0200
+++ b/tests/mpz/t-get_d_2exp.c	Fri May 18 10:23:00 2012 +0200
@@ -1,6 +1,6 @@
 /* Test mpz_get_d_2exp.
 
-Copyright 2002, 2003 Free Software Foundation, Inc.
+Copyright 2002, 2003, 2012 Free Software Foundation, Inc.
 
 This file is part of the GNU MP Library.
 
@@ -25,6 +25,32 @@
 
 
 static void
+check_zero (void)
+{
+  mpz_t   z;
+  double  got, want;
+  long    got_exp, want_exp;
+
+  mpz_init_set_ui (z, 0);
+
+  want = 0.0;
+  want_exp = 0;
+  got = mpz_get_d_2exp (&got_exp, z);
+  if (got != want || got_exp != want_exp)
+    {
+      printf    ("mpz_get_d_2exp wrong on zero\n");
+      mpz_trace ("   z    ", z);
+      d_trace   ("   want ", want);
+      d_trace   ("   got  ", got);
+      printf    ("   want exp %ld\n", want_exp);
+      printf    ("   got exp  %ld\n", got_exp);
+      abort();
+    }
+
+  mpz_clear (z);
+}
+
+static void
 check_onebit (void)
 {
   static const unsigned long data[] = {
@@ -187,6 +213,7 @@
   tests_start ();
   mp_trace_base = -16;
 
+  check_zero ();
   check_onebit ();
   check_round ();
   check_rand ();
diff -r dcc3d46fa395 -r 456eabc04434 tests/mpz/t-inp_str.c
--- a/tests/mpz/t-inp_str.c	Thu May 17 14:54:04 2012 +0200
+++ b/tests/mpz/t-inp_str.c	Fri May 18 10:23:00 2012 +0200
@@ -48,21 +48,31 @@
     { "0",   10, "0", 1 },
 
     { "abc", 10, "0", 0 },
+    { "0xf", 10, "0", 1 },
     { "ghi", 16, "0", 0 },
+    { "100", 90, "0", 0 },
 
     {  "ff", 16,  "255", 2 },
     { "-ff", 16, "-255", 3 },
     {  "FF", 16,  "255", 2 },
     { "-FF", 16, "-255", 3 },
 
-    { "z", 36, "35", 1 },
-    { "Z", 36, "35", 1 },
+    {  "z", 36, "35", 1 },
+    {  "Z", 36, "35", 1 },
+    { "1B", 59, "70", 2 },
+    {  "a", 60, "36", 1 },
+    {  "A", 61, "10", 1 },
 
     {  "0x0",    0,   "0", 3 },
-    {  "0x10",   0,  "16", 4 },
-    { "-0x0",    0,   "0", 4 },
+    {  "0X10",   0,  "16", 4 },
+    { "-0X0",    0,   "0", 4 },
     { "-0x10",   0, "-16", 5 },
 
+    {  "0b0",    0,  "0", 3 },
+    {  "0B10",   0,  "2", 4 },
+    { "-0B0",    0,  "0", 4 },
+    { "-0b10",   0, "-2", 5 },
+
     {  "00",   0,  "0", 2 },
     {  "010",  0,  "8", 3 },
     { "-00",   0,  "0", 3 },
@@ -70,6 +80,7 @@
 
     {  "0x",     0,   "0", 2 },
     {  "0",      0,   "0", 1 },
+    { " 030",   10,  "30", 4 },
   };
 
   mpz_t  got, want;


More information about the gmp-commit mailing list