2 ms·
Oh for the... don't loop until "x == y", loop until "abs(x-y) < MAX_TOLERABLE_ABS_ERROR", that's been the standard advice since forever.
by Joker_vD 5y ago
Oh for the... don't loop until "x == y", loop until "abs(x-y) < MAX_TOLERABLE_ABS_ERROR", that's been the standard advice since forever.
- FabHK 5y ago(There's no '==' on the entire page (except in Mathematica code, or for printing the results of an equality test).)
- Igelau 5y agoThat was my knee jerk reaction as well, but if you look again you'll see the loop is doing a different check than you think.
- hermitdev 5y agoTook me a second look to realize what's going on. First thought was "only 54 iterations?" as in, (initial error) * 54 >= 1. On the second look, it clicked that no, it's actually more like (initial error) * 2^54 >= 1