From 279834dd5a95c3a7f117f098ce3fe4e105d27e4e Mon Sep 17 00:00:00 2001 From: nsz Date: Apr 11 2012 10:51:29 +0000 Subject: improve strtod overflow tests --- diff --git a/src/stdlib/strtod.c b/src/stdlib/strtod.c index 013c837..08ff74a 100644 --- a/src/stdlib/strtod.c +++ b/src/stdlib/strtod.c @@ -51,6 +51,10 @@ static struct { {".3362103143112093506444937793915876332724499641527442230928779770593420866576777e-4931", 0x1p-16382L}, // 2^-16382 + 2^-16446 + eps {".3362103143112093506444937793915876332724499641527442230928779770593420866576778e-4931", 0x1.0000000000000002p-16382L}, + // 2^16384 - 2^16319 - eps + {"118973149535723176505351158982948.86679662540046955672e4900", 0x1.fffffffffffffffep16383L}, + // 2^16384 - 2^16319 + eps + {"118973149535723176505351158982948.86679662540046955673e4900", INFINITY}, }; static struct { char *s; @@ -71,12 +75,12 @@ static struct { {".2225073858507201630123055637955676152503612414573018013083228724049586647606759e-307", 0x1p-1022}, // 2^-1022 + 2^-1075 + eps {".2225073858507201630123055637955676152503612414573018013083228724049586647606760e-307", 0x1.0000000000001p-1022}, - // 2^1024 - 2^970 - 1 + // 2^1024 - 2^970 - eps {"17976931348623158079372897140530341507993413271003782693617377898044" "49682927647509466490179775872070963302864166928879109465555478519404" "02630657488671505820681908902000708383676273854845817711531764475730" "27006985557136695962284291481986083493647529271907416844436551070434" - "2711559699508093042880177904174497791", 0x1.fffffffffffffp1023}, + "2711559699508093042880177904174497791.999999999999999999999999999999", 0x1.fffffffffffffp1023}, // 2^1024 - 2^970 {"17976931348623158079372897140530341507993413271003782693617377898044" "49682927647509466490179775872070963302864166928879109465555478519404" @@ -100,8 +104,8 @@ static struct { {".1175494420887210724209590083408724842314472120785184615334540294131831453944281e-37", 0x1p-126}, // 2^-126 + 2^-150 + eps {".1175494420887210724209590083408724842314472120785184615334540294131831453944282e-37", 0x1.000002p-126}, - // 2^128 - 2^103 - 1 - {"340282356779733661637539395458142568447", 0x1.fffffep127}, + // 2^128 - 2^103 - eps + {"340282356779733661637539395458142568447.9999999999999999999", 0x1.fffffep127}, // 2^128 - 2^103 {"340282356779733661637539395458142568448", INFINITY}, };