projects
/
libm
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
long double math fixes for LD64
[libm]
/
src
/
math
/
scalbnl.c
diff --git
a/src/math/scalbnl.c
b/src/math/scalbnl.c
index
ff5db51
..
0ed5b7f
100644
(file)
--- a/
src/math/scalbnl.c
+++ b/
src/math/scalbnl.c
@@
-18,12
+18,12
@@
#include "libm.h"
#include "libm.h"
-#if LD
6
4
+#if LD
BL_MANT_DIG == 53 && LDBL_MAX_EXP == 102
4
long double scalbnl(long double x, int n)
{
return scalbn(x, n);
}
long double scalbnl(long double x, int n)
{
return scalbn(x, n);
}
-#elif
LD80 || LD128
+#elif
(LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384
static const long double
huge = 0x1p16000L,
tiny = 0x1p-16000L;
static const long double
huge = 0x1p16000L,
tiny = 0x1p-16000L;
@@
-38,11
+38,11
@@
long double scalbnl(long double x, int n)
if (k == 0) { /* 0 or subnormal x */
if ((u.bits.manh|u.bits.manl) == 0) /* +-0 */
return x;
if (k == 0) { /* 0 or subnormal x */
if ((u.bits.manh|u.bits.manl) == 0) /* +-0 */
return x;
- u.e *= 0x1p
+
128;
+ u.e *= 0x1p128;
k = u.bits.exp - 128;
if (n < -50000)
return tiny*x; /*underflow*/
k = u.bits.exp - 128;
if (n < -50000)
return tiny*x; /*underflow*/
-
}
+ }
if (k == 0x7fff) /* NaN or Inf */
return x + x;
k = k + n;
if (k == 0x7fff) /* NaN or Inf */
return x + x;
k = k + n;