diff options
author | Danny Smith <dannysmith@users.sourceforge.net> | 2003-10-21 13:05:24 +0400 |
---|---|---|
committer | Danny Smith <dannysmith@users.sourceforge.net> | 2003-10-21 13:05:24 +0400 |
commit | 672126d4f1a62a3030d5d1439d41a05525e472d5 (patch) | |
tree | 82ae8fca8967e0567d43849eafa36d331910405b /winsup/mingw/mingwex | |
parent | 4883801c0f0e5358ab04cb881d56deb023724539 (diff) |
* 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/mingwex')
-rw-r--r-- | winsup/mingw/mingwex/math/s_erf.c | 3 | ||||
-rw-r--r-- | winsup/mingw/mingwex/math/sf_erf.c | 7 |
2 files changed, 9 insertions, 1 deletions
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; } } |