summaryrefslogtreecommitdiffstats
path: root/newlib
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2006-01-10 16:51:58 +0000
committerJeff Johnston <jjohnstn@redhat.com>2006-01-10 16:51:58 +0000
commit216633f73cd9c8163b2b2fe5f6c00e8d819ade1f (patch)
tree8eff42c360f88c77599663165875c3ee89353692 /newlib
parent23de77b72babc03ab1d8a3283ccfb8cf0c042a1c (diff)
downloadcygnal-216633f73cd9c8163b2b2fe5f6c00e8d819ade1f.tar.gz
cygnal-216633f73cd9c8163b2b2fe5f6c00e8d819ade1f.tar.bz2
cygnal-216633f73cd9c8163b2b2fe5f6c00e8d819ade1f.zip
2006-01-10 Jeff Johnston <jjohnstn@redhat.com>
* libm/mathfp/s_frexp.c: Check for special values on the original input, not the manipulated output value. * libm/mathfp/sf_frexp.c: Ditto. * libm/mathfp/s_atangent.c: Don't use local value branch when checking for quadrant. * libm/mathfp/sf_atangent.c: Ditto.
Diffstat (limited to 'newlib')
-rw-r--r--newlib/ChangeLog9
-rw-r--r--newlib/libm/mathfp/s_atangent.c4
-rw-r--r--newlib/libm/mathfp/s_frexp.c21
-rw-r--r--newlib/libm/mathfp/sf_atangent.c4
-rw-r--r--newlib/libm/mathfp/sf_frexp.c21
5 files changed, 35 insertions, 24 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index 779efd67f..8e18f7f2f 100644
--- a/newlib/ChangeLog
+++ b/newlib/ChangeLog
@@ -1,3 +1,12 @@
+2006-01-10 Jeff Johnston <jjohnstn@redhat.com>
+
+ * libm/mathfp/s_frexp.c: Check for special values on
+ the original input, not the manipulated output value.
+ * libm/mathfp/sf_frexp.c: Ditto.
+ * libm/mathfp/s_atangent.c: Don't use local value branch
+ when checking for quadrant.
+ * libm/mathfp/sf_atangent.c: Ditto.
+
2006-01-09 Jeff Johnston <jjohnstn@redhat.com>
* libc/stdio/freopen.c: Switch to use isatty instead of _isatty.
diff --git a/newlib/libm/mathfp/s_atangent.c b/newlib/libm/mathfp/s_atangent.c
index 981e1c822..0a7c4d2f8 100644
--- a/newlib/libm/mathfp/s_atangent.c
+++ b/newlib/libm/mathfp/s_atangent.c
@@ -197,9 +197,9 @@ _DEFUN (atangent, (double, double, double, int),
if (arctan2)
{
- if (u < 0.0 || branch == 2)
+ if (u < 0.0)
res = __PI - res;
- if (v < 0.0 || branch == 1)
+ if (v < 0.0)
res = -res;
}
else if (x < 0.0)
diff --git a/newlib/libm/mathfp/s_frexp.c b/newlib/libm/mathfp/s_frexp.c
index 08611e9a7..54fa336c8 100644
--- a/newlib/libm/mathfp/s_frexp.c
+++ b/newlib/libm/mathfp/s_frexp.c
@@ -82,6 +82,17 @@ double frexp (double d, int *exp)
double f;
__uint32_t hd, ld, hf, lf;
+ /* Check for special values. */
+ switch (numtest (d))
+ {
+ case NAN:
+ case INF:
+ errno = EDOM;
+ case 0:
+ *exp = 0;
+ return (d);
+ }
+
EXTRACT_WORDS (hd, ld, d);
/* Get the exponent. */
@@ -94,16 +105,6 @@ double frexp (double d, int *exp)
INSERT_WORDS (f, hf, lf);
- /* Check for special values. */
- switch (numtest (f))
- {
- case NAN:
- case INF:
- errno = EDOM;
- *exp = 0;
- return (f);
- }
-
return (f);
}
diff --git a/newlib/libm/mathfp/sf_atangent.c b/newlib/libm/mathfp/sf_atangent.c
index 55a90063c..7a8f0cebe 100644
--- a/newlib/libm/mathfp/sf_atangent.c
+++ b/newlib/libm/mathfp/sf_atangent.c
@@ -126,9 +126,9 @@ _DEFUN (atangentf, (float, float, float, int),
if (arctan2)
{
- if (u < 0.0 || branch == 2)
+ if (u < 0.0)
res = __PI - res;
- if (v < 0.0 || branch == 1)
+ if (v < 0.0)
res = -res;
}
else if (x < 0.0)
diff --git a/newlib/libm/mathfp/sf_frexp.c b/newlib/libm/mathfp/sf_frexp.c
index c2751f65c..7f25195c8 100644
--- a/newlib/libm/mathfp/sf_frexp.c
+++ b/newlib/libm/mathfp/sf_frexp.c
@@ -24,6 +24,17 @@ float frexpf (float d, int *exp)
float f;
__int32_t wf, wd;
+ /* Check for special values. */
+ switch (numtestf (d))
+ {
+ case NAN:
+ case INF:
+ errno = EDOM;
+ case 0:
+ *exp = 0;
+ return (d);
+ }
+
GET_FLOAT_WORD (wd, d);
/* Get the exponent. */
@@ -35,16 +46,6 @@ float frexpf (float d, int *exp)
SET_FLOAT_WORD (f, wf);
- /* Check for special values. */
- switch (numtestf (f))
- {
- case NAN:
- case INF:
- errno = EDOM;
- *exp = 0;
- return (f);
- }
-
return (f);
}