123456789101112131415161718192021222324252627282930313233 |
- #include "math.h"
- #include "math_private.h"
- #include <errno.h>
- double __ieee754_scalb(double x, double fn)
- {
- if (isnan(x)||isnan(fn)) return x*fn;
- if (!isfinite(fn)) {
- if(fn>0.0) return x*fn;
- else return x/(-fn);
- }
- if (rint(fn)!=fn) return (fn-fn)/(fn-fn);
- if ( fn > 65000.0) return scalbn(x, 65000);
- if (-fn > 65000.0) return scalbn(x,-65000);
- return scalbn(x,(int)fn);
- }
|