the problem and solution are discussed here http://9fans.net/archive/2009/01/234 since the post, i removed the underflow test as i found it was not effective, at least on the 386. you may disagree. further note: there is also lib/ap/gen/strtod.c which seems to suffer from many overflow/underflow problems. i didn't change it because i don't understand why another copy of strtod is necessary. Reference: /n/sources/patch/applied/apestrtod Date: Thu Jul 30 15:13:44 CES 2009 Signed-off-by: quanstro@quanstro.net --- /sys/src/ape/lib/ap/stdio/strtod.c Thu Jul 30 15:11:25 2009 +++ /sys/src/ape/lib/ap/stdio/strtod.c Thu Jul 30 15:11:23 2009 @@ -394,6 +394,8 @@ /* Get starting approximation = rv * 10**e1 */ if (e1 > 0) { + if(nd0 + e1 - 1> DBL_MAX_10_EXP) + goto ovfl; if (i = e1 & 15) rv.d *= tens[i]; if (e1 &= ~15) {