projects
/
libm
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5718e96
)
long double math fixes for LD64
author
nsz
<nsz@port70.net>
Sun, 11 Mar 2012 14:38:39 +0000
(15:38 +0100)
committer
nsz
<nsz@port70.net>
Sun, 11 Mar 2012 14:38:39 +0000
(15:38 +0100)
13 files changed:
src/math/expl.c
patch
|
blob
|
history
src/math/fdiml.c
patch
|
blob
|
history
src/math/fmaxl.c
patch
|
blob
|
history
src/math/fminl.c
patch
|
blob
|
history
src/math/ilogbl.c
patch
|
blob
|
history
src/math/ldexp.c
patch
|
blob
|
history
src/math/ldexpf.c
patch
|
blob
|
history
src/math/ldexpl.c
patch
|
blob
|
history
src/math/nexttowardl.c
patch
|
blob
|
history
src/math/powl.c
patch
|
blob
|
history
src/math/remainderl.c
patch
|
blob
|
history
src/math/remquol.c
patch
|
blob
|
history
src/math/scalblnl.c
patch
|
blob
|
history
diff --git
a/src/math/expl.c
b/src/math/expl.c
index
ed794fb
..
898cf1a
100644
(file)
--- a/
src/math/expl.c
+++ b/
src/math/expl.c
@@
-70,7
+70,7
@@
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
long double expl(long double x)
{
#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
}
#elif LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384
diff --git
a/src/math/fdiml.c
b/src/math/fdiml.c
index
5bb950c
..
cda3022
100644
(file)
--- a/
src/math/fdiml.c
+++ b/
src/math/fdiml.c
@@
-1,4
+1,11
@@
#include "libm.h"
#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))
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;
}
return y;
return x > y ? x - y : 0;
}
+#endif
diff --git
a/src/math/fmaxl.c
b/src/math/fmaxl.c
index
7020ed4
..
8a1e365
100644
(file)
--- a/
src/math/fmaxl.c
+++ b/
src/math/fmaxl.c
@@
-1,4
+1,11
@@
#include "libm.h"
#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))
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;
}
return signbit(x) ? y : x;
return x < y ? y : x;
}
+#endif
diff --git
a/src/math/fminl.c
b/src/math/fminl.c
index
9ee0285
..
ae7159a
100644
(file)
--- a/
src/math/fminl.c
+++ b/
src/math/fminl.c
@@
-1,4
+1,11
@@
#include "libm.h"
#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))
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;
}
return signbit(x) ? x : y;
return x < y ? x : y;
}
+#endif
diff --git
a/src/math/ilogbl.c
b/src/math/ilogbl.c
index
3b42c4d
..
ed9ddcb
100644
(file)
--- a/
src/math/ilogbl.c
+++ b/
src/math/ilogbl.c
@@
-1,5
+1,6
@@
#include <limits.h>
#include "libm.h"
#include <limits.h>
#include "libm.h"
+
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
int ilogbl(long double x)
{
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
int ilogbl(long double x)
{
diff --git
a/src/math/ldexp.c
b/src/math/ldexp.c
index
bbf13e6
..
36835db
100644
(file)
--- a/
src/math/ldexp.c
+++ b/
src/math/ldexp.c
@@
-1,4
+1,5
@@
#include "libm.h"
#include "libm.h"
+
double ldexp(double x, int n)
{
return scalbn(x, n);
double ldexp(double x, int n)
{
return scalbn(x, n);
diff --git
a/src/math/ldexpf.c
b/src/math/ldexpf.c
index
fe684ff
..
f0981ae
100644
(file)
--- a/
src/math/ldexpf.c
+++ b/
src/math/ldexpf.c
@@
-1,4
+1,5
@@
#include "libm.h"
#include "libm.h"
+
float ldexpf(float x, int n)
{
return scalbnf(x, n);
float ldexpf(float x, int n)
{
return scalbnf(x, n);
diff --git
a/src/math/ldexpl.c
b/src/math/ldexpl.c
index
79b3e86
..
885ff6e
100644
(file)
--- a/
src/math/ldexpl.c
+++ b/
src/math/ldexpl.c
@@
-1,4
+1,5
@@
#include "libm.h"
#include "libm.h"
+
long double ldexpl(long double x, int n)
{
return scalbnl(x, n);
long double ldexpl(long double x, int n)
{
return scalbnl(x, n);
diff --git
a/src/math/nexttowardl.c
b/src/math/nexttowardl.c
index
48ce417
..
c393ce9
100644
(file)
--- a/
src/math/nexttowardl.c
+++ b/
src/math/nexttowardl.c
@@
-1,4
+1,5
@@
#include "libm.h"
#include "libm.h"
+
long double nexttowardl(long double x, long double y)
{
return nextafterl(x, y);
long double nexttowardl(long double x, long double y)
{
return nextafterl(x, y);
diff --git
a/src/math/powl.c
b/src/math/powl.c
index
0f0d894
..
690f294
100644
(file)
--- a/
src/math/powl.c
+++ b/
src/math/powl.c
@@
-69,7
+69,12
@@
#include "libm.h"
#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
/* Table size */
#define NXT 32
diff --git
a/src/math/remainderl.c
b/src/math/remainderl.c
index
7794560
..
b99f938
100644
(file)
--- a/
src/math/remainderl.c
+++ b/
src/math/remainderl.c
@@
-1,4
+1,5
@@
#include "libm.h"
#include "libm.h"
+
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
long double remainderl(long double x, long double y)
{
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
long double remainderl(long double x, long double y)
{
diff --git
a/src/math/remquol.c
b/src/math/remquol.c
index
cacc5ba
..
dd18f35
100644
(file)
--- a/
src/math/remquol.c
+++ b/
src/math/remquol.c
@@
-11,6
+11,7
@@
*/
#include "libm.h"
*/
#include "libm.h"
+
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
long double remquol(long double x, long double y, int *quo)
{
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
long double remquol(long double x, long double y, int *quo)
{
diff --git
a/src/math/scalblnl.c
b/src/math/scalblnl.c
index
4199e44
..
82ebbed
100644
(file)
--- a/
src/math/scalblnl.c
+++ b/
src/math/scalblnl.c
@@
-1,5
+1,12
@@
#include <limits.h>
#include "libm.h"
#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)
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);
}
n = INT_MIN;
return scalbnl(x, n);
}
+#endif