]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - math/atest-exp.c
Fix the inaccuracy of j0f/j1f/y0f/y1f [BZ #14469, #14470, #14471, #14472]
[thirdparty/glibc.git] / math / atest-exp.c
index 2f168c9a6ddf5d6a28c05e40c5ab01348d4ef079..aeda33ed9588a7b3d18ef5b14c788e3e216cb7c7 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 2000, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Geoffrey Keating <Geoff.Keating@anu.edu.au>, 1997.
 
@@ -13,9 +13,8 @@
    Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
 
 #include <stdio.h>
 #include <math.h>
@@ -62,7 +61,7 @@ exp_mpn (mp1 ex, mp1 x)
    unsigned n;
    mp1 xp;
    mp2 tmp;
-   mp_limb_t chk, round;
+   mp_limb_t chk __attribute__ ((unused));
    mp1 tol;
 
    memset (xp, 0, sizeof (mp1));
@@ -80,7 +79,7 @@ exp_mpn (mp1 ex, mp1 x)
        mpn_mul_n (tmp, xp, x, SZ);
        assert (tmp[SZ * 2 - 1] == 0);
        if (n > 0)
-        round = mpn_divmod_1 (xp, tmp + FRAC / mpbpl, SZ, n);
+        mpn_divmod_1 (xp, tmp + FRAC / mpbpl, SZ, n);
        chk = mpn_add_n (ex, ex, xp, SZ);
        assert (chk == 0);
        n++;
@@ -103,8 +102,8 @@ mpn_bitsize(const mp_limb_t *SRC_PTR, mp_size_t SIZE)
    return i * mpbpl + j;
 }
 
-int
-main (void)
+static int
+do_test (void)
 {
    mp1 ex, x, xt, e2, e3;
    int i;
@@ -191,3 +190,7 @@ main (void)
 
    return failures == 0 ? 0 : 1;
 }
+
+#define TIMEOUT 200
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"