use isinf instead of isinff. this doesn't introduce a functional change -

isinf works for float as well, and is more portable.

from Ngie Cooper in PR bin/51838
This commit is contained in:
maya 2017-01-20 21:15:56 +00:00
parent a87e9a2b62
commit 1d815938de
1 changed files with 9 additions and 9 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_pow.c,v 1.4 2015/09/08 05:24:27 dholland Exp $ */
/* $NetBSD: t_pow.c,v 1.5 2017/01/20 21:15:56 maya Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@ -29,7 +29,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: t_pow.c,v 1.4 2015/09/08 05:24:27 dholland Exp $");
__RCSID("$NetBSD: t_pow.c,v 1.5 2017/01/20 21:15:56 maya Exp $");
#include <atf-c.h>
#include <math.h>
@ -379,12 +379,12 @@ ATF_TC_BODY(powf_inf_neg_x, tc)
*/
z = powf(x, 3.0);
if (isinff(z) == 0 || signbit(z) == 0)
if (isinf(z) == 0 || signbit(z) == 0)
atf_tc_fail_nonfatal("powf(-Inf, 3.0) != -Inf");
z = powf(x, 4.0);
if (isinff(z) == 0 || signbit(z) != 0)
if (isinf(z) == 0 || signbit(z) != 0)
atf_tc_fail_nonfatal("powf(-Inf, 4.0) != +Inf");
/*
@ -421,7 +421,7 @@ ATF_TC_BODY(powf_inf_neg_y, tc)
*/
z = powf(0.1, y);
if (isinff(z) == 0 || signbit(z) != 0)
if (isinf(z) == 0 || signbit(z) != 0)
atf_tc_fail_nonfatal("powf(0.1, -Inf) != +Inf");
z = powf(1.1, y);
@ -452,7 +452,7 @@ ATF_TC_BODY(powf_inf_pos_x, tc)
z = powf(x, 2.0);
if (isinff(z) == 0 || signbit(z) != 0)
if (isinf(z) == 0 || signbit(z) != 0)
atf_tc_fail_nonfatal("powf(+Inf, 2.0) != +Inf");
}
@ -478,7 +478,7 @@ ATF_TC_BODY(powf_inf_pos_y, tc)
z = powf(1.1, y);
if (isinff(z) == 0 || signbit(z) != 0)
if (isinf(z) == 0 || signbit(z) != 0)
atf_tc_fail_nonfatal("powf(1.1, +Inf) != +Inf");
}
@ -496,8 +496,8 @@ ATF_TC_BODY(powf_one_neg_x, tc)
/*
* If x is -1.0, and y is +-Inf, 1.0 shall be returned.
*/
ATF_REQUIRE(isinff(infp) != 0);
ATF_REQUIRE(isinff(infn) != 0);
ATF_REQUIRE(isinf(infp) != 0);
ATF_REQUIRE(isinf(infn) != 0);
if (powf(-1.0, infp) != 1.0) {
atf_tc_expect_fail("PR lib/45372");