Cool, that makes life a lot simpler.
Roger - I am glad if it helps!
It does make me pause a bit, only because this isn’t how I see floating points used normally. Floats and doubles are often generated by either noisy instruments or noisy calculations and - as evident in the above examples - you can lose precision merely moving data around if you’re not careful.
So more often we see things like
filter(foo, val>=2.421-0.000001 and val<=2.421+0.000001)
which gives you a controlled degree of tolerable error. Here’s a nice article with some more detail - and provides example minimal “error Epslion” quantities:
Just for what it’s worth - I obviously don’t know your use case so feel free to ignore if this doesn’t apply.