]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - math/e_scalbf.c
Update copyright dates with scripts/update-copyrights.
[thirdparty/glibc.git] / math / e_scalbf.c
index 3f2e853353fa7b3ee6ed475e7fd1b214652f34f0..5782fc9db62576e51861214bc7e3f24ae11fd220 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2014 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2019 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
 
@@ -16,7 +16,6 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <fenv.h>
 #include <math.h>
 #include <math_private.h>
 
@@ -25,11 +24,8 @@ static float
 __attribute__ ((noinline))
 invalid_fn (float x, float fn)
 {
-  if (__rintf (fn) != fn)
-    {
-      feraiseexcept (FE_INVALID);
-      return __nan ("");
-    }
+  if (rintf (fn) != fn)
+    return (fn - fn) / (fn - fn);
   else if (fn > 65000.0f)
     return __scalbnf (x, 65000);
   else
@@ -40,11 +36,11 @@ invalid_fn (float x, float fn)
 float
 __ieee754_scalbf (float x, float fn)
 {
-  if (__glibc_unlikely (__isnanf (x)))
+  if (__glibc_unlikely (isnan (x)))
     return x * fn;
-  if (__glibc_unlikely (!__finitef (fn)))
+  if (__glibc_unlikely (!isfinite (fn)))
     {
-      if (__isnanf (fn) || fn > 0.0f)
+      if (isnan (fn) || fn > 0.0f)
        return x * fn;
       if (x == 0.0f)
        return x;