Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests/lib/libm Avoid promotion in subexpressions.
details: https://anonhg.NetBSD.org/src/rev/9dc9fdec17d2
branches: trunk
changeset: 327109:9dc9fdec17d2
user: joerg <joerg%NetBSD.org@localhost>
date: Thu Feb 27 17:26:02 2014 +0000
description:
Avoid promotion in subexpressions.
diffstat:
tests/lib/libm/t_atan.c | 6 +++---
tests/lib/libm/t_exp.c | 10 +++++-----
tests/lib/libm/t_fmod.c | 4 ++--
tests/lib/libm/t_log.c | 6 +++---
4 files changed, 13 insertions(+), 13 deletions(-)
diffs (117 lines):
diff -r ab48367c4b4f -r 9dc9fdec17d2 tests/lib/libm/t_atan.c
--- a/tests/lib/libm/t_atan.c Thu Feb 27 17:25:28 2014 +0000
+++ b/tests/lib/libm/t_atan.c Thu Feb 27 17:26:02 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_atan.c,v 1.9 2013/06/14 05:39:28 isaki Exp $ */
+/* $NetBSD: t_atan.c,v 1.10 2014/02/27 17:26:02 joerg Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -184,7 +184,7 @@
const float x = -1.0L / 0.0L;
const float eps = 1.0e-7;
- if (fabsf(atanf(x) + M_PI_2) > eps)
+ if (fabsf(atanf(x) + (float)M_PI_2) > eps)
atf_tc_fail_nonfatal("atanf(-Inf) != -pi/2");
#endif
}
@@ -201,7 +201,7 @@
const float x = +1.0L / 0.0L;
const float eps = 1.0e-7;
- if (fabsf(atanf(x) - M_PI_2) > eps)
+ if (fabsf(atanf(x) - (float)M_PI_2) > eps)
atf_tc_fail_nonfatal("atanf(+Inf) != pi/2");
#endif
}
diff -r ab48367c4b4f -r 9dc9fdec17d2 tests/lib/libm/t_exp.c
--- a/tests/lib/libm/t_exp.c Thu Feb 27 17:25:28 2014 +0000
+++ b/tests/lib/libm/t_exp.c Thu Feb 27 17:26:02 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_exp.c,v 1.3 2013/04/09 11:42:56 isaki Exp $ */
+/* $NetBSD: t_exp.c,v 1.4 2014/02/27 17:26:02 joerg Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -245,7 +245,7 @@
#ifndef __vax__
const float x = -0.0L;
- if (fabsf(exp2f(x) - 1.0) > 0.0)
+ if (fabsf(exp2f(x) - 1.0f) > 0.0)
atf_tc_fail_nonfatal("exp2f(-0.0) != 1.0");
#endif
}
@@ -261,7 +261,7 @@
#ifndef __vax__
const float x = 0.0L;
- if (fabsf(exp2f(x) - 1.0) > 0.0)
+ if (fabsf(exp2f(x) - 1.0f) > 0.0)
atf_tc_fail_nonfatal("exp2f(+0.0) != 1.0");
#endif
}
@@ -465,7 +465,7 @@
#ifndef __vax__
const float x = -0.0L;
- if (fabsf(expf(x) - 1.0) > 0.0)
+ if (fabsf(expf(x) - 1.0f) > 0.0)
atf_tc_fail_nonfatal("expf(-0.0) != 1.0");
#endif
}
@@ -481,7 +481,7 @@
#ifndef __vax__
const float x = 0.0L;
- if (fabsf(expf(x) - 1.0) > 0.0)
+ if (fabsf(expf(x) - 1.0f) > 0.0)
atf_tc_fail_nonfatal("expf(+0.0) != 1.0");
#endif
}
diff -r ab48367c4b4f -r 9dc9fdec17d2 tests/lib/libm/t_fmod.c
--- a/tests/lib/libm/t_fmod.c Thu Feb 27 17:25:28 2014 +0000
+++ b/tests/lib/libm/t_fmod.c Thu Feb 27 17:26:02 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_fmod.c,v 1.1 2013/11/12 16:48:39 joerg Exp $ */
+/* $NetBSD: t_fmod.c,v 1.2 2014/02/27 17:26:02 joerg Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -49,7 +49,7 @@
ATF_CHECK(fmod(2.0, 0.5) == 0);
ATF_CHECK(fmodl(2.0, 0.5) == 0);
- ATF_CHECK(fabsf(fmodf(1.0, 0.1) - 0.1) <= 55 * FLT_EPSILON);
+ ATF_CHECK(fabsf(fmodf(1.0, 0.1) - 0.1f) <= 55 * FLT_EPSILON);
ATF_CHECK(fabs(fmod(1.0, 0.1) - 0.1) <= 55 * DBL_EPSILON);
ATF_CHECK(fabsl(fmodl(1.0, 0.1L) - 0.1L) <= 55 * LDBL_EPSILON);
}
diff -r ab48367c4b4f -r 9dc9fdec17d2 tests/lib/libm/t_log.c
--- a/tests/lib/libm/t_log.c Thu Feb 27 17:25:28 2014 +0000
+++ b/tests/lib/libm/t_log.c Thu Feb 27 17:26:02 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_log.c,v 1.9 2014/02/09 21:26:07 jmmv Exp $ */
+/* $NetBSD: t_log.c,v 1.10 2014/02/27 17:26:02 joerg Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: t_log.c,v 1.9 2014/02/09 21:26:07 jmmv Exp $");
+__RCSID("$NetBSD: t_log.c,v 1.10 2014/02/27 17:26:02 joerg Exp $");
#include <atf-c.h>
#include <atf-c/config.h>
@@ -809,7 +809,7 @@
{
const float eps = 1.0e-7;
- if (fabsf(logf(M_E) - 1.0) > eps)
+ if (fabsf(logf(M_E) - 1.0f) > eps)
atf_tc_fail_nonfatal("logf(e) != 1");
}
Home |
Main Index |
Thread Index |
Old Index