]>
git.ipfire.org Git - thirdparty/glibc.git/blob - sysdeps/libm-ieee754/e_scalbl.c
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 if (__rintl(fn
)!=fn
) return (fn
-fn
)/(fn
-fn
);
55 if ( fn
> 65000.0) return __scalbnl(x
, 65000);
56 if (-fn
> 65000.0) return __scalbnl(x
,-65000);
57 return __scalbnl(x
,(int)fn
);