2 ms·
Properties of the Correction Loop in David Gay’s strtod()
- nitrogen 16y agoIs testing random values sufficient to prove the worst case required iterations, or was that just an initial pass before performing a rigorous mathematical analysis? In other words, how do you know that you haven't missed another almost-pathological case that would require some large, but finite, number of correction loop iterations?
- wglb 16y agoSeems like an analysis in the first place might have been a good idea from the beginning.
- CountHackulus 16y agoThat seems like something that could be run in a parallel fashion on EC2. Run it for every possible value up to 40 significant digits. It's not really something that can be run as a unit test, but it might be nice to be absolutely sure all the bugs have been ferreted out.
- nitrogen 16y ago10^40 is a very big number. If my rough calculations are correct, even ignoring shifts in the decimal point, you're talking about a minimum of a hundred quadrillion billion years of computing time, assuming a hopelessly optimistic 1 cycle per iteration on a 3GHz processor. 10e40/3e9/86400/365/1e9~=1.4e14 Edit: though there aren't 10^40 possible 40-digit 64-bit IEEE-754 values (log10(2^64)~=19.27).