00001 #if !defined(__ppc__)
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #if defined(LIBM_SCCS) && !defined(lint)
00015 static char rcsid[] = "$NetBSD: w_scalb.c,v 1.6 1995/05/10 20:49:48 jtc Exp $";
00016 #endif
00017
00018
00019
00020
00021
00022
00023
00024 #include "math.h"
00025 #include "mathP.h"
00026
00027 #include <linux/errno.h>
00028
00029 extern int libm_errno;
00030
00031 #ifdef __STDC__
00032 #ifdef _SCALB_INT
00033 double scalb(double x, int fn)
00034 #else
00035 double scalb(double x, double fn)
00036 #endif
00037 #else
00038 double scalb(x,fn)
00039 #ifdef _SCALB_INT
00040 double x; int fn;
00041 #else
00042 double x,fn;
00043 #endif
00044 #endif
00045 {
00046 #ifdef _IEEE_LIBM
00047 return __ieee754_scalb(x,fn);
00048 #else
00049 double z;
00050 z = __ieee754_scalb(x,fn);
00051 if(_LIB_VERSION == _IEEE_) return z;
00052 if(!(finite(z)||isnan(z))&&finite(x)) {
00053 return __kernel_standard(x,(double)fn,32);
00054 }
00055 if(z==0.0&&z!=x) {
00056 return __kernel_standard(x,(double)fn,33);
00057 }
00058 #ifndef _SCALB_INT
00059 if(!finite(fn)) libm_errno = ERANGE;
00060 #endif
00061 return z;
00062 #endif
00063 }
00064 #endif