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:
parent
23de77b72b
commit
216633f73c
|
@ -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>
|
2006-01-09 Jeff Johnston <jjohnstn@redhat.com>
|
||||||
|
|
||||||
* libc/stdio/freopen.c: Switch to use isatty instead of _isatty.
|
* libc/stdio/freopen.c: Switch to use isatty instead of _isatty.
|
||||||
|
|
|
@ -197,9 +197,9 @@ _DEFUN (atangent, (double, double, double, int),
|
||||||
|
|
||||||
if (arctan2)
|
if (arctan2)
|
||||||
{
|
{
|
||||||
if (u < 0.0 || branch == 2)
|
if (u < 0.0)
|
||||||
res = __PI - res;
|
res = __PI - res;
|
||||||
if (v < 0.0 || branch == 1)
|
if (v < 0.0)
|
||||||
res = -res;
|
res = -res;
|
||||||
}
|
}
|
||||||
else if (x < 0.0)
|
else if (x < 0.0)
|
||||||
|
|
|
@ -82,6 +82,17 @@ double frexp (double d, int *exp)
|
||||||
double f;
|
double f;
|
||||||
__uint32_t hd, ld, hf, lf;
|
__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);
|
EXTRACT_WORDS (hd, ld, d);
|
||||||
|
|
||||||
/* Get the exponent. */
|
/* Get the exponent. */
|
||||||
|
@ -94,16 +105,6 @@ double frexp (double d, int *exp)
|
||||||
|
|
||||||
INSERT_WORDS (f, hf, lf);
|
INSERT_WORDS (f, hf, lf);
|
||||||
|
|
||||||
/* Check for special values. */
|
|
||||||
switch (numtest (f))
|
|
||||||
{
|
|
||||||
case NAN:
|
|
||||||
case INF:
|
|
||||||
errno = EDOM;
|
|
||||||
*exp = 0;
|
|
||||||
return (f);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (f);
|
return (f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -126,9 +126,9 @@ _DEFUN (atangentf, (float, float, float, int),
|
||||||
|
|
||||||
if (arctan2)
|
if (arctan2)
|
||||||
{
|
{
|
||||||
if (u < 0.0 || branch == 2)
|
if (u < 0.0)
|
||||||
res = __PI - res;
|
res = __PI - res;
|
||||||
if (v < 0.0 || branch == 1)
|
if (v < 0.0)
|
||||||
res = -res;
|
res = -res;
|
||||||
}
|
}
|
||||||
else if (x < 0.0)
|
else if (x < 0.0)
|
||||||
|
|
|
@ -24,6 +24,17 @@ float frexpf (float d, int *exp)
|
||||||
float f;
|
float f;
|
||||||
__int32_t wf, wd;
|
__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_FLOAT_WORD (wd, d);
|
||||||
|
|
||||||
/* Get the exponent. */
|
/* Get the exponent. */
|
||||||
|
@ -35,16 +46,6 @@ float frexpf (float d, int *exp)
|
||||||
|
|
||||||
SET_FLOAT_WORD (f, wf);
|
SET_FLOAT_WORD (f, wf);
|
||||||
|
|
||||||
/* Check for special values. */
|
|
||||||
switch (numtestf (f))
|
|
||||||
{
|
|
||||||
case NAN:
|
|
||||||
case INF:
|
|
||||||
errno = EDOM;
|
|
||||||
*exp = 0;
|
|
||||||
return (f);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (f);
|
return (f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue