e_scalb.c: Call scalbln instead of scalbn on 16-bit targets to ensure constant fits in an int.

This commit is contained in:
Jon Beniston 2018-08-31 22:42:29 +01:00 committed by Corinna Vinschen
parent 3017f23f1c
commit fcc1e7039f
1 changed files with 5 additions and 0 deletions

View File

@ -46,8 +46,13 @@
else return x/(-fn);
}
if (rint(fn)!=fn) return (fn-fn)/(fn-fn);
#if INT_MAX == 32767
if ( fn > 65000.0) return scalbln(x, 65000);
if (-fn > 65000.0) return scalbln(x,-65000);
#else
if ( fn > 65000.0) return scalbn(x, 65000);
if (-fn > 65000.0) return scalbn(x,-65000);
#endif
return scalbn(x,(int)fn);
#endif
}