[Gmp-commit] /var/hg/gmp: tests/mpn/t-broot.c: Test also k=1, - typo.

mercurial at gmplib.org mercurial at gmplib.org
Fri Aug 14 15:39:06 UTC 2015


details:   /var/hg/gmp/rev/e5a96e5eb06d
changeset: 16766:e5a96e5eb06d
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Fri Aug 14 17:38:58 2015 +0200
description:
tests/mpn/t-broot.c: Test also k=1, - typo.

diffstat:

 tests/mpn/t-broot.c |  15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diffs (28 lines):

diff -r 41f8b5ca01d1 -r e5a96e5eb06d tests/mpn/t-broot.c
--- a/tests/mpn/t-broot.c	Wed Aug 12 08:16:53 2015 +0200
+++ b/tests/mpn/t-broot.c	Fri Aug 14 17:38:58 2015 +0200
@@ -95,10 +95,23 @@
 	  gmp_fprintf (stderr, "k   = %Mx\n", k);
 	  gmp_fprintf (stderr, "a   = %Nx\n", ap, n);
 	  gmp_fprintf (stderr, "r   = %Nx\n", rp, n);
-	  gmp_fprintf (stderr, "r^n = %Nx\n", pp, n);
+	  gmp_fprintf (stderr, "r^k = %Nx\n", pp, n);
 	  abort ();
 	}
     }
+  
+  mpn_broot (rp, ap, MAX_LIMBS, 1);
+  if (mpn_cmp (ap, rp, MAX_LIMBS) != 0)
+    {
+      gmp_fprintf (stderr,
+		   "mpn_broot returned bad result: %u limbs\n",
+		   (unsigned) MAX_LIMBS);
+      gmp_fprintf (stderr, "k   = %Mx\n", 1);
+      gmp_fprintf (stderr, "a   = %Nx\n", ap, MAX_LIMBS);
+      gmp_fprintf (stderr, "r   = %Nx\n", rp, MAX_LIMBS);
+      abort ();
+    }
+
   TMP_FREE;
   tests_end ();
   return 0;


More information about the gmp-commit mailing list