Module Name: src Committed By: riastradh Date: Sun May 12 20:17:57 UTC 2024
Modified Files: src/tests/lib/libm: t_next.c Log Message: tests/lib/libm/t_next: Disable a test if long double is double. This test, to verify nexttoward(x, x*(1 - LDBL_EPSILON/2)) moves in the direction of x*(1 - LDBL_EPSILON/2), only makes sense if long double has more precision than double -- the point of the exercise is to verify that nexttoward moves even if the direction parameter can't be rounded to double. But if long double is just double, this test makes no sense. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/tests/lib/libm/t_next.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/tests/lib/libm/t_next.c diff -u src/tests/lib/libm/t_next.c:1.6 src/tests/lib/libm/t_next.c:1.7 --- src/tests/lib/libm/t_next.c:1.6 Sat May 11 02:07:54 2024 +++ src/tests/lib/libm/t_next.c Sun May 12 20:17:57 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: t_next.c,v 1.6 2024/05/11 02:07:54 riastradh Exp $ */ +/* $NetBSD: t_next.c,v 1.7 2024/05/12 20:17:57 riastradh Exp $ */ /*- * Copyright (c) 2024 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: t_next.c,v 1.6 2024/05/11 02:07:54 riastradh Exp $"); +__RCSID("$NetBSD: t_next.c,v 1.7 2024/05/12 20:17:57 riastradh Exp $"); #include <atf-c.h> #include <float.h> @@ -110,10 +110,12 @@ check(const double *x, unsigned n) for (i = n; i --> 1;) { ATF_REQUIRE_MSG(x[i - 1] < x[i], "i=%u", i); +#ifdef __HAVE_LONG_DOUBLE if (isnormal(x[i])) { CHECK(i, nexttoward, x[i], x[i]*(1 - LDBL_EPSILON/2), x[i - 1]); } +#endif CHECK(i, nextafter, x[i], x[i - 1], x[i - 1]); CHECK(i, nexttoward, x[i], x[i - 1], x[i - 1]);