summaryrefslogtreecommitdiffstats
path: root/lib/msun/src/s_scalbln.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/msun/src/s_scalbln.c')
-rw-r--r--lib/msun/src/s_scalbln.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/msun/src/s_scalbln.c b/lib/msun/src/s_scalbln.c
index 2aa6900..7d134a6 100644
--- a/lib/msun/src/s_scalbln.c
+++ b/lib/msun/src/s_scalbln.c
@@ -35,7 +35,9 @@ scalbln (double x, long n)
{
int in;
- in = (n > INT_MAX) ? INT_MAX : (n < INT_MIN) ? INT_MIN : n;
+ in = (int)n;
+ if (in != n)
+ in = (n > 0) ? INT_MAX: INT_MIN;
return (scalbn(x, in));
}
@@ -44,7 +46,9 @@ scalblnf (float x, long n)
{
int in;
- in = (n > INT_MAX) ? INT_MAX : (n < INT_MIN) ? INT_MIN : n;
+ in = (int)n;
+ if (in != n)
+ in = (n > 0) ? INT_MAX: INT_MIN;
return (scalbnf(x, in));
}
@@ -53,6 +57,9 @@ scalblnl (long double x, long n)
{
int in;
- in = (n > INT_MAX) ? INT_MAX : (n < INT_MIN) ? INT_MIN : n;
+ in = (int)n;
+ if (in != n) {
+ in = (n > 0) ? INT_MAX: INT_MIN;
+ }
return (scalbnl(x, in));
}
OpenPOWER on IntegriCloud