diff options
author | Danny Smith <dannysmith@users.sourceforge.net> | 2003-10-21 09:05:24 +0000 |
---|---|---|
committer | Danny Smith <dannysmith@users.sourceforge.net> | 2003-10-21 09:05:24 +0000 |
commit | 672126d4f1a62a3030d5d1439d41a05525e472d5 (patch) | |
tree | 82ae8fca8967e0567d43849eafa36d331910405b /winsup/mingw | |
parent | 4883801c0f0e5358ab04cb881d56deb023724539 (diff) | |
download | cygnal-672126d4f1a62a3030d5d1439d41a05525e472d5.tar.gz cygnal-672126d4f1a62a3030d5d1439d41a05525e472d5.tar.bz2 cygnal-672126d4f1a62a3030d5d1439d41a05525e472d5.zip |
* mingwex/math/s_erf.c (erf): Set errno to ERANGE if
beyond approximation limit.
* mingwex/math/sf_erf.c (erff): Likewise.
Diffstat (limited to 'winsup/mingw')
-rw-r--r-- | winsup/mingw/ChangeLog | 6 | ||||
-rw-r--r-- | winsup/mingw/mingwex/math/s_erf.c | 3 | ||||
-rw-r--r-- | winsup/mingw/mingwex/math/sf_erf.c | 7 |
3 files changed, 15 insertions, 1 deletions
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 <dannysmith@users.sourceforge.net> + + * 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 <dannysmith@users.sourceforge.net> * 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 <math.h> #include <stdint.h> +#include <errno.h> #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 <math.h> #include <stdint.h> +#include <errno.h> + #define __ieee754_expf expf -#include <math.h> + 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; } } |