long double math fixes for LD64
authornsz <nsz@port70.net>
Sun, 11 Mar 2012 14:38:39 +0000 (15:38 +0100)
committernsz <nsz@port70.net>
Sun, 11 Mar 2012 14:38:39 +0000 (15:38 +0100)
13 files changed:
src/math/expl.c
src/math/fdiml.c
src/math/fmaxl.c
src/math/fminl.c
src/math/ilogbl.c
src/math/ldexp.c
src/math/ldexpf.c
src/math/ldexpl.c
src/math/nexttowardl.c
src/math/powl.c
src/math/remainderl.c
src/math/remquol.c
src/math/scalblnl.c

index ed794fb..898cf1a 100644 (file)
@@ -70,7 +70,7 @@
 #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
 long double expl(long double x)
 {
-       return x;
+       return exp(x);
 }
 #elif LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384
 
index 5bb950c..cda3022 100644 (file)
@@ -1,4 +1,11 @@
 #include "libm.h"
+
+#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
+long double fdiml(long double x, long double y)
+{
+       return fdim(x, y);
+}
+#else
 long double fdiml(long double x, long double y)
 {
        if (isnan(x))
@@ -7,3 +14,4 @@ long double fdiml(long double x, long double y)
                return y;
        return x > y ? x - y : 0;
 }
+#endif
index 7020ed4..8a1e365 100644 (file)
@@ -1,4 +1,11 @@
 #include "libm.h"
+
+#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
+long double fmaxl(long double x, long double y)
+{
+       return fmax(x, y);
+}
+#else
 long double fmaxl(long double x, long double y)
 {
        if (isnan(x))
@@ -10,3 +17,4 @@ long double fmaxl(long double x, long double y)
                return signbit(x) ? y : x;
        return x < y ? y : x;
 }
+#endif
index 9ee0285..ae7159a 100644 (file)
@@ -1,4 +1,11 @@
 #include "libm.h"
+
+#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
+long double fminl(long double x, long double y)
+{
+       return fmin(x, y);
+}
+#else
 long double fminl(long double x, long double y)
 {
        if (isnan(x))
@@ -10,3 +17,4 @@ long double fminl(long double x, long double y)
                return signbit(x) ? x : y;
        return x < y ? x : y;
 }
+#endif
index 3b42c4d..ed9ddcb 100644 (file)
@@ -1,5 +1,6 @@
 #include <limits.h>
 #include "libm.h"
+
 #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
 int ilogbl(long double x)
 {
index bbf13e6..36835db 100644 (file)
@@ -1,4 +1,5 @@
 #include "libm.h"
+
 double ldexp(double x, int n)
 {
        return scalbn(x, n);
index fe684ff..f0981ae 100644 (file)
@@ -1,4 +1,5 @@
 #include "libm.h"
+
 float ldexpf(float x, int n)
 {
        return scalbnf(x, n);
index 79b3e86..885ff6e 100644 (file)
@@ -1,4 +1,5 @@
 #include "libm.h"
+
 long double ldexpl(long double x, int n)
 {
        return scalbnl(x, n);
index 48ce417..c393ce9 100644 (file)
@@ -1,4 +1,5 @@
 #include "libm.h"
+
 long double nexttowardl(long double x, long double y)
 {
        return nextafterl(x, y);
index 0f0d894..690f294 100644 (file)
 
 #include "libm.h"
 
-#if LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384
+#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
+long double powl(long double x, long double y)
+{
+       return pow(x, y);
+}
+#elif LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384
 
 /* Table size */
 #define NXT 32
index 7794560..b99f938 100644 (file)
@@ -1,4 +1,5 @@
 #include "libm.h"
+
 #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
 long double remainderl(long double x, long double y)
 {
index cacc5ba..dd18f35 100644 (file)
@@ -11,6 +11,7 @@
  */
 
 #include "libm.h"
+
 #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
 long double remquol(long double x, long double y, int *quo)
 {
index 4199e44..82ebbed 100644 (file)
@@ -1,5 +1,12 @@
 #include <limits.h>
 #include "libm.h"
+
+#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
+long double scalblnl(long double x, long n)
+{
+       return scalbln(x, n);
+}
+#else
 long double scalblnl(long double x, long n)
 {
        if (n > INT_MAX)
@@ -8,3 +15,4 @@ long double scalblnl(long double x, long n)
                n = INT_MIN;
        return scalbnl(x, n);
 }
+#endif