aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2021-06-22 16:38:27 +0000
committerDimitry Andric <dim@FreeBSD.org>2021-06-22 16:38:45 +0000
commitdf3b437c1e073eb83e9a93af1c417f3ee8d0de3b (patch)
treea8978953a3aa9ce7c7eca75dd0629d620adbf217 /lib
parent800e82d12411938c4484c7d7de5bf9f5e641e43c (diff)
Diffstat (limited to 'lib')
-rw-r--r--lib/msun/src/s_lround.c8
-rw-r--r--lib/msun/tests/lround_test.c7
2 files changed, 6 insertions, 9 deletions
diff --git a/lib/msun/src/s_lround.c b/lib/msun/src/s_lround.c
index 66d9183a74bc..c4d305401ac8 100644
--- a/lib/msun/src/s_lround.c
+++ b/lib/msun/src/s_lround.c
@@ -49,9 +49,11 @@ __FBSDID("$FreeBSD$");
* that everything is in range. At compile time, INRANGE(x) should reduce to
* two floating-point comparisons in the former case, or TRUE otherwise.
*/
-static const type dtype_min = (type)DTYPE_MIN - 0.5;
-static const type dtype_max = (type)DTYPE_MAX + 0.5;
-#define INRANGE(x) (dtype_max - (type)DTYPE_MAX != 0.5 || \
+static const type type_min = (type)DTYPE_MIN;
+static const type type_max = (type)DTYPE_MAX;
+static const type dtype_min = type_min - 0.5;
+static const type dtype_max = type_max + 0.5;
+#define INRANGE(x) (dtype_max - type_max != 0.5 || \
((x) > dtype_min && (x) < dtype_max))
dtype
diff --git a/lib/msun/tests/lround_test.c b/lib/msun/tests/lround_test.c
index a6daa5459c7b..ddb2b2cea9b3 100644
--- a/lib/msun/tests/lround_test.c
+++ b/lib/msun/tests/lround_test.c
@@ -40,14 +40,9 @@ __FBSDID("$FreeBSD$");
#define IGNORE 0x12345
-/*
- * XXX The volatile here is to avoid gcc's bogus constant folding and work
- * around the lack of support for the FENV_ACCESS pragma.
- */
#define test(func, x, result, excepts) do { \
- volatile double _d = x; \
ATF_REQUIRE_EQ(0, feclearexcept(FE_ALL_EXCEPT)); \
- volatile double _r = (func)(_d); \
+ long long _r = (func)(x); \
CHECK_FP_EXCEPTIONS_MSG(excepts, FE_ALL_EXCEPT, "for %s(%s)", \
#func, #x); \
if ((excepts & FE_INVALID) != 0) { \