diff options
author | Jim Wilson <jimw@sifive.com> | 2017-12-12 11:39:13 -0800 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2017-12-13 11:33:19 +0100 |
commit | c874f1145ff5d2fa461cef21d6f8d575138fcdbf (patch) | |
tree | 7c7177b9ebd240ad2df1b8c8813aad25638886dc /newlib/libm | |
parent | c338bc22554fcddf64f12148785d07c1a4021160 (diff) | |
download | newlib-c874f1145ff5d2fa461cef21d6f8d575138fcdbf.zip newlib-c874f1145ff5d2fa461cef21d6f8d575138fcdbf.tar.gz newlib-c874f1145ff5d2fa461cef21d6f8d575138fcdbf.tar.bz2 |
newlib: Don't do double divide in powf.
* Use 0.0f instead of 0.0 in divide.
Diffstat (limited to 'newlib/libm')
-rw-r--r-- | newlib/libm/math/wf_pow.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/newlib/libm/math/wf_pow.c b/newlib/libm/math/wf_pow.c index 9a10254..f753b52 100644 --- a/newlib/libm/math/wf_pow.c +++ b/newlib/libm/math/wf_pow.c @@ -108,7 +108,9 @@ if (_LIB_VERSION == _SVID_) exc.retval = 0.0; else - exc.retval = 0.0/0.0; /* X/Open allow NaN */ + /* Use a float divide, to avoid a soft-float double + divide call on single-float only targets. */ + exc.retval = (0.0f/0.0f); /* X/Open allow NaN */ if (_LIB_VERSION == _POSIX_) errno = EDOM; else if (!matherr(&exc)) { |