about summary refs log tree commit diff
path: root/sysdeps/generic/e_scalbl.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-02-19 23:07:28 +0000
committerUlrich Drepper <drepper@redhat.com>2001-02-19 23:07:28 +0000
commitd210ca02ec8a5ba034946c57b85c2f3e503a6017 (patch)
treeeea5e5b7d3eae5c4608add6a9cd7e4cdd9341f67 /sysdeps/generic/e_scalbl.c
parent2d7faa721d72da439dd3b732ff9a41d096438cc8 (diff)
downloadglibc-d210ca02ec8a5ba034946c57b85c2f3e503a6017.tar.gz
glibc-d210ca02ec8a5ba034946c57b85c2f3e503a6017.tar.xz
glibc-d210ca02ec8a5ba034946c57b85c2f3e503a6017.zip
Update.
	* sysdeps/generic/e_scalb.c: Set invalid exception for invalid
	parameters.
	* sysdeps/generic/e_scalbf.c: New file.
	* sysdeps/generic/e_scalbl.c: New file.
Diffstat (limited to 'sysdeps/generic/e_scalbl.c')
-rw-r--r--sysdeps/generic/e_scalbl.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/sysdeps/generic/e_scalbl.c b/sysdeps/generic/e_scalbl.c
index dccc876c85..fb2914dc5a 100644
--- a/sysdeps/generic/e_scalbl.c
+++ b/sysdeps/generic/e_scalbl.c
@@ -24,6 +24,7 @@ static char rcsid[] = "$NetBSD: $";
  * should use scalbnl() instead.
  */
 
+#include <fenv.h>
 #include "math.h"
 #include "math_private.h"
 
@@ -52,10 +53,17 @@ static char rcsid[] = "$NetBSD: $";
 	    else if (x == 0)
 	      return x;
 	    else if (!__finitel (x))
-	      return __nanl ("");
+	      {
+		feraiseexcept (FE_INVALID);
+		return __nanl ("");
+	      }
 	    else       return x/(-fn);
 	}
-	if (__rintl(fn)!=fn) return __nanl ("");
+	if (__rintl(fn)!=fn)
+	  {
+	    feraiseexcept (FE_INVALID);
+	    return __nanl ("");
+	  }
 	if ( fn > 65000.0) return __scalbnl(x, 65000);
 	if (-fn > 65000.0) return __scalbnl(x,-65000);
 	return __scalbnl(x,(int)fn);