2 ms·
I don't like how he's measuring accuracy, here. Something that produces (3.149) is treated as closer than (3.139). 22/7 looks marginally better, if we compare
by dllthomas 14y ago
I don't like how he's measuring accuracy, here. Something that produces (3.149) is treated as closer than (3.139).
22/7 looks marginally better, if we compare actual error. It's the same number of characters as 3.14, but about 20% less error. 355/113, meanwhile, is not only better than 3.14159 (same number of characters) but actually even better than 3.141592 (about 60% less error).
It's also easier to remember, due to the repeated digits.
- tailrecursion 14y agoYes, Jon's metric for measuring the value of an approximation is wrong and so is his conclusion.
- monochromatic 14y agoWhy is the conclusion wrong? It still seems like the trend should be the same.
- dllthomas 14y agoThe conclusion is that they are useless, but this is predicated on a notion that there is some use to which they can be put. The "trend" therefore is not what matters - who cares if I can't find a hugely accurate rational form past what I couldn't remember anyway? What matters is those few near the start. He dismisses 22/7 as being no better than 3.14 because it only agrees in the same number of digits; it is in fact more accurate, and easier to use for some operations. 355/113 is not only easier to remember but also substantially more accurate than the decimal approximation with the same number of digits. Rarely will you need more accuracy than that in your head (or on your napkin). If you need more in your program, M_PI is also 4 characters...