Subject: fix for math lib when using -O2
To: None <netbsd-bugs@sun-lamp.cs.berkeley.edu>
From: Frank van der Linden <vdlinden@fwi.uva.nl>
List: netbsd-bugs
Date: 01/02/1994 22:01:39
After compiling all of the libraries with -O2 -m486, here are the
changes I made.
The first change is to fix the "overflow in constant" by using
HUGE_VAL (infinity) instead of 1e300 * 1e300.
The second change is using zero instead of tiny * tiny.
Onno van der Linden c/o vdlinden@fwi.uva.nl (Frank van der Linden)
*** /usr/src/lib/libm/common/pow.c.old Sun Jan 2 17:50:35 1994
--- /usr/src/lib/libm/common/pow.c Sun Jan 2 18:28:18 1994
***************
*** 176,180 ****
{
struct Double s, t, log__D();
! double exp__D(), huge = 1e300, tiny = 1e-300;
if (x == zero)
--- 176,180 ----
{
struct Double s, t, log__D();
! double exp__D();
if (x == zero)
***************
*** 182,186 ****
return (zero);
else if (_IEEE)
! return (huge*huge);
else
return (infnan(ERANGE));
--- 182,186 ----
return (zero);
else if (_IEEE)
! return (HUGE_VAL);
else
return (infnan(ERANGE));
***************
*** 191,202 ****
return (zero);
else if (_IEEE)
! return (huge*huge);
else
return (infnan(ERANGE));
if (y >= 7e18) /* infinity */
if (x < 1)
! return(tiny*tiny);
else if (_IEEE)
! return (huge*huge);
else
return (infnan(ERANGE));
--- 191,202 ----
return (zero);
else if (_IEEE)
! return (HUGE_VAL);
else
return (infnan(ERANGE));
if (y >= 7e18) /* infinity */
if (x < 1)
! return(zero);
else if (_IEEE)
! return (HUGE_VAL);
else
return (infnan(ERANGE));
------------------------------------------------------------------------------