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

mercurial at gmplib.org mercurial at gmplib.org
Thu Oct 29 17:21:02 UTC 2020


details:   /var/hg/gmp-6.2/rev/1752acbfc298
changeset: 18110:1752acbfc298
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Thu Oct 29 18:20:14 2020 +0100
description:
tests/mpz/t-get_d.c: Test also the case zero.

details:   /var/hg/gmp-6.2/rev/6098a63a5c31
changeset: 18111:6098a63a5c31
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Thu Oct 29 18:20:36 2020 +0100
description:
tests/mpf/t-trunc.c: Use mpf_size.

details:   /var/hg/gmp-6.2/rev/2671976ec1ea
changeset: 18112:2671976ec1ea
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Thu Oct 29 18:20:48 2020 +0100
description:
tests/mpf/t-get_d_2exp.c: Test also the case zero.

details:   /var/hg/gmp-6.2/rev/85041f80c7a8
changeset: 18113:85041f80c7a8
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Thu Oct 29 18:20:55 2020 +0100
description:
ChangeLog

diffstat:

 ChangeLog                |   6 ++++++
 tests/mpf/t-get_d_2exp.c |  12 +++++++++++-
 tests/mpf/t-trunc.c      |   4 ++--
 tests/mpz/t-get_d.c      |   9 ++++++++-
 4 files changed, 27 insertions(+), 4 deletions(-)

diffs (86 lines):

diff -r 3328dc92960a -r 85041f80c7a8 ChangeLog
--- a/ChangeLog	Sun Oct 25 22:14:38 2020 +0100
+++ b/ChangeLog	Thu Oct 29 18:20:55 2020 +0100
@@ -1,3 +1,9 @@
+2020-10-30 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+	* tests/mpf/t-get_d_2exp.c: Test also the case zero.
+	* tests/mpz/t-get_d.c: Likewise.
+	* tests/mpf/t-trunc.c: Use mpf_size.
+
 2020-10-25 Marco Bodrato <bodrato at mail.dm.unipi.it>
 
 	* configfsf.guess: Updated to version 2020-10-22, from gnulib.
diff -r 3328dc92960a -r 85041f80c7a8 tests/mpf/t-get_d_2exp.c
--- a/tests/mpf/t-get_d_2exp.c	Sun Oct 25 22:14:38 2020 +0100
+++ b/tests/mpf/t-get_d_2exp.c	Thu Oct 29 18:20:55 2020 +0100
@@ -1,6 +1,6 @@
 /* Test mpf_get_d_2exp.
 
-Copyright 2002, 2003, 2017 Free Software Foundation, Inc.
+Copyright 2002, 2003, 2017, 2020 Free Software Foundation, Inc.
 
 This file is part of the GNU MP Library test suite.
 
@@ -39,6 +39,16 @@
 
   mpf_init2 (f, 3);
 
+  got = mpf_get_d_2exp (&got_exp, f);
+  if (got != 0 || got_exp != 0)
+    {
+      printf    ("mpf_get_d_2exp wrong on zero\n", exp);
+      mpf_trace ("   f    ", f);
+      d_trace   ("   got  ", got);
+      printf    ("   got exp  %ld\n", got_exp);
+      abort();
+    }
+
   for (exp = -513; exp <= 513; exp++)
     {
       size_t i;
diff -r 3328dc92960a -r 85041f80c7a8 tests/mpf/t-trunc.c
--- a/tests/mpf/t-trunc.c	Sun Oct 25 22:14:38 2020 +0100
+++ b/tests/mpf/t-trunc.c	Thu Oct 29 18:20:55 2020 +0100
@@ -1,6 +1,6 @@
 /* Test mpf_trunc, mpf_ceil, mpf_floor.
 
-Copyright 2001, 2002 Free Software Foundation, Inc.
+Copyright 2001, 2002, 2020 Free Software Foundation, Inc.
 
 This file is part of the GNU MP Library test suite.
 
@@ -78,7 +78,7 @@
 
   /* Can't do these unconditionally in case truncation by mpf_set strips
      some low non-zero limbs which would have rounded the result.  */
-  if (ABSIZ(src) <= PREC(trunc)+1)
+  if (mpf_size (src) <= PREC(trunc)+1)
     {
       CHECK_INPLACE ("mpf_ceil",  mpf_ceil,  ceil);
       CHECK_INPLACE ("mpf_floor", mpf_floor, floor);
diff -r 3328dc92960a -r 85041f80c7a8 tests/mpz/t-get_d.c
--- a/tests/mpz/t-get_d.c	Sun Oct 25 22:14:38 2020 +0100
+++ b/tests/mpz/t-get_d.c	Thu Oct 29 18:20:55 2020 +0100
@@ -1,6 +1,6 @@
 /* Test mpz_get_d.
 
-Copyright 2002, 2012 Free Software Foundation, Inc.
+Copyright 2002, 2012, 2020 Free Software Foundation, Inc.
 
 This file is part of the GNU MP Library test suite.
 
@@ -38,6 +38,13 @@
 
   mpz_init (z);
 
+  got = mpz_get_d (z);
+  if (got != 0)
+    {
+      printf    ("mpz_get_d wrong on zero\n");
+      abort();
+    }
+
   mpz_set_ui (z, 1L);
   want = 1.0;
 



More information about the gmp-commit mailing list