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.
28 #include "math_private.h"
32 long double __ieee754_scalbl(long double x, int fn)
34 long double __ieee754_scalbl(x,fn)
35 long double x; int fn;
39 long double __ieee754_scalbl(long double x, long double fn)
41 long double __ieee754_scalbl(x,fn)
47 return __scalbnl(x,fn);
49 if (__isnanl(x)||__isnanl(fn)) return x*fn;
51 if(fn>0.0) return x*fn;
54 else if (!__finitel (x))
58 if (__rintl(fn)!=fn) return __nanl ("");
59 if ( fn > 65000.0) return __scalbnl(x, 65000);
60 if (-fn > 65000.0) return __scalbnl(x,-65000);
61 return __scalbnl(x,(int)fn);