Revert "Update to the latest s_scalbln.c from msun."

This reverts commit a2f4e102f2.
This commit is contained in:
Viral B. Shah 2015-02-21 07:50:35 +05:30
parent a2f4e102f2
commit 8247b5af78

View file

@ -24,30 +24,55 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#include "cdefs-compat.h"
//__FBSDID("$FreeBSD: src/lib/msun/src/s_scalbln.c,v 1.2 2005/03/07 04:57:50 das Exp $");
#include <limits.h>
#include <openlibm_math.h>
#define NMAX 65536
#define NMIN -65536
#include "math_private.h"
DLLEXPORT double
scalbln(double x, long n)
scalbln (double x, long n)
{
int in;
return (scalbn(x, (n > NMAX) ? NMAX : (n < NMIN) ? NMIN : (int)n));
in = (int)n;
if (in != n) {
if (n > 0)
in = INT_MAX;
else
in = INT_MIN;
}
return (scalbn(x, in));
}
DLLEXPORT float
scalblnf(float x, long n)
scalblnf (float x, long n)
{
int in;
return (scalbnf(x, (n > NMAX) ? NMAX : (n < NMIN) ? NMIN : (int)n));
in = (int)n;
if (in != n) {
if (n > 0)
in = INT_MAX;
else
in = INT_MIN;
}
return (scalbnf(x, in));
}
DLLEXPORT long double
scalblnl(long double x, long n)
scalblnl (long double x, long n)
{
int in;
return (scalbnl(x, (n > NMAX) ? NMAX : (n < NMIN) ? NMIN : (int)n));
in = (int)n;
if (in != n) {
if (n > 0)
in = INT_MAX;
else
in = INT_MIN;
}
return (scalbnl(x, (int)n));
}