From: Danny Smith Date: Tue, 21 Oct 2003 09:05:24 +0000 (+0000) Subject: * mingwex/math/s_erf.c (erf): Set errno to ERANGE if X-Git-Tag: corinna-01~65 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=672126d4f1a62a3030d5d1439d41a05525e472d5;p=newlib-cygwin.git * mingwex/math/s_erf.c (erf): Set errno to ERANGE if beyond approximation limit. * mingwex/math/sf_erf.c (erff): Likewise. --- diff --git a/winsup/mingw/ChangeLog b/winsup/mingw/ChangeLog index 4d2317936..a8a7aa7d8 100644 --- a/winsup/mingw/ChangeLog +++ b/winsup/mingw/ChangeLog @@ -1,3 +1,9 @@ +2003-10-21 Danny Smith + + * mingwex/math/s_erf.c (erf): Set errno to ERANGE if + beyond approximation limit. + * mingwex/math/sf_erf.c (erff): Likewise. + 2003-10-17 Danny Smith * include/stdio.h (getc): Cast result to unsigned char before diff --git a/winsup/mingw/mingwex/math/s_erf.c b/winsup/mingw/mingwex/math/s_erf.c index 4673f48b3..3cba24dd2 100644 --- a/winsup/mingw/mingwex/math/s_erf.c +++ b/winsup/mingw/mingwex/math/s_erf.c @@ -110,6 +110,7 @@ #include #include +#include #define __ieee754_exp exp @@ -337,6 +338,8 @@ sb7 = -2.24409524465858183362e+01; /* 0xC03670E2, 0x42712D62 */ __ieee754_exp((z-x)*(z+x)+R/S); if(hx>0) return r/x; else return two-r/x; } else { + /* set range error */ + errno = ERANGE; if(hx>0) return tiny*tiny; else return two-tiny; } } diff --git a/winsup/mingw/mingwex/math/sf_erf.c b/winsup/mingw/mingwex/math/sf_erf.c index 20a20fc25..1fca80e94 100644 --- a/winsup/mingw/mingwex/math/sf_erf.c +++ b/winsup/mingw/mingwex/math/sf_erf.c @@ -16,10 +16,13 @@ /* #include "fdlibm.h" */ +#include #include +#include + #define __ieee754_expf expf -#include + typedef union { @@ -254,6 +257,8 @@ sb7 = -2.2440952301e+01; /* 0xc1b38712 */ __ieee754_expf((z-x)*(z+x)+R/S); if(hx>0) return r/x; else return two-r/x; } else { + /* set range error */ + errno = ERANGE; if(hx>0) return tiny*tiny; else return two-tiny; } }