From d210ca02ec8a5ba034946c57b85c2f3e503a6017 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 19 Feb 2001 23:07:28 +0000 Subject: 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. --- sysdeps/generic/e_scalb.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'sysdeps/generic/e_scalb.c') diff --git a/sysdeps/generic/e_scalb.c b/sysdeps/generic/e_scalb.c index d9a326b2b2..2e4094390a 100644 --- a/sysdeps/generic/e_scalb.c +++ b/sysdeps/generic/e_scalb.c @@ -5,7 +5,7 @@ * * Developed at SunPro, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice + * software is freely granted, provided that this notice * is preserved. * ==================================================== */ @@ -16,10 +16,11 @@ static char rcsid[] = "$NetBSD: e_scalb.c,v 1.6 1995/05/10 20:46:09 jtc Exp $"; /* * __ieee754_scalb(x, fn) is provide for - * passing various standard test suite. One + * passing various standard test suite. One * should use scalbn() instead. */ +#include #include "math.h" #include "math_private.h" @@ -48,10 +49,17 @@ static char rcsid[] = "$NetBSD: e_scalb.c,v 1.6 1995/05/10 20:46:09 jtc Exp $"; else if (x == 0) return x; else if (!__finite (x)) - return __nan (""); + { + feraiseexcept (FE_INVALID); + return __nan (""); + } else return x/(-fn); } - if (__rint(fn)!=fn) return __nan (""); + if (__rint(fn)!=fn) + { + feraiseexcept (FE_INVALID); + return __nan (""); + } if ( fn > 65000.0) return __scalbn(x, 65000); if (-fn > 65000.0) return __scalbn(x,-65000); return __scalbn(x,(int)fn); -- cgit v1.2.3