aboutsummaryrefslogtreecommitdiff
path: root/src/base/fmt/float.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/base/fmt/float.c')
-rw-r--r--src/base/fmt/float.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/base/fmt/float.c b/src/base/fmt/float.c
index 63ea80f..8a42dfc 100644
--- a/src/base/fmt/float.c
+++ b/src/base/fmt/float.c
@@ -529,7 +529,7 @@ fmtstrtod(char *as, char **aas)
ex = -ex;
dp += ex;
if(dp < -Maxe){
- errno = ERANGE;
+ /* errno = ERANGE; */
goto ret0; /* underflow by exp */
} else
if(dp > +Maxe)
@@ -617,7 +617,7 @@ retnan:
retinf:
/* Unix strtod requires these. Plan 9 would return Inf(0) or Inf(-1). */
- errno = ERANGE;
+ /* errno = ERANGE; */
if(flag & Fsign)
return -HUGE_VAL;
return HUGE_VAL;
@@ -630,7 +630,7 @@ out:
d = -d;
d = ldexp(d, bp - Prec*Nbits);
if(d == 0) /* underflow */
- errno = ERANGE;
+ /* errno = ERANGE; */
return d;
}
@@ -694,12 +694,10 @@ fmtexp(char *p, int e, int ucase)
static void
dtoa(double f, char *s, int *exp, int *neg, int *len)
{
- int c, d, e2, e, ee, i, ndigit, oerrno;
+ int c, d, e2, e, ee, i, ndigit;
char buf[NSIGNIF+10];
double g;
- oerrno = errno;
-
*neg = 0;
if(f < 0){
f = -f;
@@ -785,7 +783,7 @@ dtoa(double f, char *s, int *exp, int *neg, int *len)
*exp = e;
*len = ndigit;
- errno = oerrno;
+ /* errno = oerrno; */
}