1 /* e_scalbl.c -- long double version of s_scalb.c.
2 * Conversion to long double by Ulrich Drepper,
3 * Cygnus Support, drepper@cygnus.com.
7 * ====================================================
8 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
10 * Developed at SunPro, a Sun Microsystems, Inc. business.
11 * Permission to use, copy, modify, and distribute this
12 * software is freely granted, provided that this notice
14 * ====================================================
17 #if defined(LIBM_SCCS) && !defined(lint)
18 static char rcsid[] = "$NetBSD: $";
22 * __ieee754_scalbl(x, fn) is provide for
23 * passing various standard test suite. One
24 * should use scalbnl() instead.
29 #include "math_private.h"
33 long double __ieee754_scalbl(long double x, int fn)
35 long double __ieee754_scalbl(x,fn)
36 long double x; int fn;
40 long double __ieee754_scalbl(long double x, long double fn)
42 long double __ieee754_scalbl(x,fn)
48 return __scalbnl(x,fn);
50 if (__isnanl(x)||__isnanl(fn)) return x*fn;
52 if(fn>0.0) return x*fn;
55 else if (!__finitel (x))
58 feraiseexcept (FE_INVALID);
67 feraiseexcept (FE_INVALID);
71 if ( fn > 65000.0) return __scalbnl(x, 65000);
72 if (-fn > 65000.0) return __scalbnl(x,-65000);
73 return __scalbnl(x,(int)fn);