by gotaquestion · 4y ago · 0 comments
Also, I wouldn't use epsilon, because that is a very small number and is related to representation of numbers. I would instead use a larger "tolerance" value, in `if |a-b| < tol ...` because that indicates the expected accuracy of your algorithm (unless you're really working with 1e-80 tolerance?). But TFA explains that.
But back to point (a) is that not reasonable? (If not, I've got some code to change... :)
I imagine the downside with a chosen "epsilon" (which I used as an alias for any tolerance) is that it can be truncated on some machines, plus this equation on its own doesn't do relative accuracy.
On an LEGO EV3, Python's float is 1e38 max with 7 significant digits.
I've never run into problems, which is why I keep using it, too.