Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests/lib/libm Consistently use long double.
details: https://anonhg.NetBSD.org/src/rev/e68622ff706c
branches: trunk
changeset: 328078:e68622ff706c
user: joerg <joerg%NetBSD.org@localhost>
date: Tue Mar 25 17:30:14 2014 +0000
description:
Consistently use long double.
diffstat:
tests/lib/libm/t_libm.h | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diffs (28 lines):
diff -r 2da01122712f -r e68622ff706c tests/lib/libm/t_libm.h
--- a/tests/lib/libm/t_libm.h Tue Mar 25 17:23:37 2014 +0000
+++ b/tests/lib/libm/t_libm.h Tue Mar 25 17:30:14 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_libm.h,v 1.5 2014/03/16 22:49:27 dsl Exp $ */
+/* $NetBSD: t_libm.h,v 1.6 2014/03/25 17:30:14 joerg Exp $ */
/*
* Check result of fn(arg) is correct within the bounds.
@@ -7,12 +7,15 @@
* be out of range for the function - so save and print as 'long double'.
* (otherwise you can get 'inf != inf' reported!)
*/
-#define T_LIBM_CHECK(subtest, fn, arg, expect, epsilon) do { \
+#define T_LIBM_CHECK(subtest, fn, arg, expect_, epsilon_) do { \
+ long double epsilon = epsilon_; \
+ long double expect = expect_; \
long double r = fn(arg); \
- double e = fabs(r - expect); \
+ long double e = fabsl(r - expect); \
if (r != expect && e > epsilon) \
atf_tc_fail_nonfatal( \
- "subtest %u: " #fn "(%g) is %Lg (%.14La) not %g (%.13a), error %g (%.6a) > %g", \
+ "subtest %u: " #fn "(%g) is %Lg (%.14La) " \
+ "not %Lg (%.13La), error %Lg (%.6La) > %Lg", \
subtest, arg, r, r, expect, expect, e, e, epsilon); \
} while (0)
Home |
Main Index |
Thread Index |
Old Index