summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2021-02-09 13:57:38 -0800
committerOri Bernstein <ori@eigenstate.org>2021-02-09 13:57:38 -0800
commit0719ce2aa793f28ca63d2395a3568b75a60db27b (patch)
treebb27038ec43dddb2c5111d3e62e392ede28aa206
parent2d8adc7b881f20a8cc2dbccab84fc7e1655752a6 (diff)
downloadplan9front-0719ce2aa793f28ca63d2395a3568b75a60db27b.tar.xz
stdio: remove erronous assert in dtoa
The value of `k` in dtoa() is an estimate of floor(log10(d)), where `d` is the number being converted. The code was asserting that 'k' was less than 100, but the full range of a double goes to 10^308 or so. This means that the majority of the range of a double would trigger that assert.
-rw-r--r--sys/src/libstdio/dtoa.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/sys/src/libstdio/dtoa.c b/sys/src/libstdio/dtoa.c
index 80fd3c73e..7f6c70657 100644
--- a/sys/src/libstdio/dtoa.c
+++ b/sys/src/libstdio/dtoa.c
@@ -811,7 +811,6 @@ dtoa(double _d, int mode, int ndigits, int *decpt, int *sign, char **rve)
b5 = -k;
s5 = 0;
}
- assert(k < 100);
if (mode < 0 || mode > 9)
mode = 0;
try_quick = 1;