From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 68471 invoked by alias); 13 Dec 2017 10:04:15 -0000 Mailing-List: contact newlib-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-cvs-owner@sourceware.org Received: (qmail 68428 invoked by uid 9078); 13 Dec 2017 10:04:15 -0000 Date: Wed, 13 Dec 2017 10:04:00 -0000 Message-ID: <20171213100415.68426.qmail@sourceware.org> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Corinna Vinschen To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] Don't call double rint from float powf. X-Act-Checkin: newlib-cygwin X-Git-Author: Jim Wilson X-Git-Refname: refs/heads/master X-Git-Oldrev: efce18d7541edd709dc10315e54c1842e14fbf63 X-Git-Newrev: c338bc22554fcddf64f12148785d07c1a4021160 X-SW-Source: 2017-q4/txt/msg00081.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=c338bc22554fcddf64f12148785d07c1a4021160 commit c338bc22554fcddf64f12148785d07c1a4021160 Author: Jim Wilson Date: Tue Dec 12 11:38:01 2017 -0800 Don't call double rint from float powf. Updated patch to use 0.0f in addition to calling rintf. Tested same way as before, with a testcase that triggers the code and make check. OK? newlib/ * libm/math/wf_pow.c (powf): Call rintf instead of rint. Use 0.0f for compare. Diff: --- newlib/libm/math/wf_pow.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/newlib/libm/math/wf_pow.c b/newlib/libm/math/wf_pow.c index be45355..9a10254 100644 --- a/newlib/libm/math/wf_pow.c +++ b/newlib/libm/math/wf_pow.c @@ -127,11 +127,11 @@ if (_LIB_VERSION == _SVID_) { exc.retval = HUGE; y *= 0.5; - if(x<0.0&&rint(y)!=y) exc.retval = -HUGE; + if(x<0.0f&&rintf(y)!=y) exc.retval = -HUGE; } else { exc.retval = HUGE_VAL; y *= 0.5; - if(x<0.0&&rint(y)!=y) exc.retval = -HUGE_VAL; + if(x<0.0f&&rintf(y)!=y) exc.retval = -HUGE_VAL; } if (_LIB_VERSION == _POSIX_) errno = ERANGE;