1 /* @(#)w_scalb.c 5.1 93/09/24 */
3 * ====================================================
4 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
6 * Developed at SunPro, a Sun Microsystems, Inc. business.
7 * Permission to use, copy, modify, and distribute this
8 * software is freely granted, provided that this notice
10 * ====================================================
13 #if defined(LIBM_SCCS) && !defined(lint)
14 static char rcsid
[] = "$NetBSD: w_scalb.c,v 1.6 1995/05/10 20:49:48 jtc Exp $";
18 * wrapper scalb(double x, double fn) is provide for
19 * passing various standard test suite. One
20 * should use scalbn() instead.
24 #include "math_private.h"
30 double __scalb(double x
, int fn
) /* wrapper scalb */
32 double __scalb(double x
, double fn
) /* wrapper scalb */
35 double __scalb(x
,fn
) /* wrapper scalb */
44 return __ieee754_scalb(x
,fn
);
47 z
= __ieee754_scalb(x
,fn
);
48 if(_LIB_VERSION
== _IEEE_
) return z
;
49 if(!(__finite(z
)||__isnan(z
))&&__finite(x
)) {
50 return __kernel_standard(x
,(double)fn
,32); /* scalb overflow */
53 return __kernel_standard(x
,(double)fn
,33); /* scalb underflow */
56 if(!__finite(fn
)) __set_errno (ERANGE
);
61 weak_alias (__scalb
, scalb
)
63 strong_alias (__scalb
, __scalbl
)
64 weak_alias (__scalb
, scalbl
)