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.
This commit is contained in:
Jeff Johnston 2006-01-10 16:51:58 +00:00
parent 23de77b72b
commit 216633f73c
5 changed files with 35 additions and 24 deletions

View File

@ -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.

View File

@ -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)

View File

@ -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);
}

View File

@ -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)

View File

@ -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);
}