OSDN Git Service

* mingwex/math/s_erf.c (erf): Set errno to ERANGE if
authordannysmith <dannysmith>
Tue, 21 Oct 2003 09:05:24 +0000 (09:05 +0000)
committerdannysmith <dannysmith>
Tue, 21 Oct 2003 09:05:24 +0000 (09:05 +0000)
beyond approximation limit.
* mingwex/math/sf_erf.c (erff): Likewise.

winsup/mingw/ChangeLog
winsup/mingw/mingwex/math/s_erf.c
winsup/mingw/mingwex/math/sf_erf.c

index 4d23179..a8a7aa7 100644 (file)
@@ -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
index 4673f48..3cba24d 100644 (file)
 
 #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;
        }
 }
index 20a20fc..1fca80e 100644 (file)
 /*
 #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;
        }
 }