4 ms·
The fact that 10000 - 2 = 9998 probably has something to do with it. Compare and contrast the result for 1 / 99998.
by pja 13y ago
The fact that 10000 - 2 = 9998 probably has something to do with it. Compare and contrast the result for 1 / 99998.
- archgoon 13y agoPretty much. 1/9998 = 1/(10000-2) = 1/(10000)*1/(1-2/(10000) Since 2/10000 is very small, it is well approximated by the taylor expansion for 1/(1-x), which is simply Sum(x^n) Since x is 2/10000, we get powers of two, which keep getting shifted to the right. Like a bit pattern, they don't overlap when added, so we get the sequence above.