ref: f8055f6df2fe3e659c151aebc74776ea5b4ba303
parent: d1ee3f91d97971e4008bb79d6f348ee1d3cd7605
author: Ori Bernstein <ori@eigenstate.org>
date: Tue Feb 9 08:57:38 EST 2021
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.
--- a/sys/src/libstdio/dtoa.c
+++ b/sys/src/libstdio/dtoa.c
@@ -811,7 +811,6 @@
b5 = -k;
s5 = 0;
}
- assert(k < 100);
if (mode < 0 || mode > 9)
mode = 0;
try_quick = 1;
--
⑨