examples of floating point problems https://jvns.ca/blog/2023/01/13/examples-of-floating-point-problems/
@b0rk Maybe it's useful to mention what that problem is? The way I phrase it is that FP is intended for computations where you care about relative accuracy.
@robryk @b0rk My take is that floating point is for when you want to do non-integer arithmetic fast, without using much memory, and you're willing to trade off some accuracy to do that. And that it used to be necessary for many everyday computations when computers were much slower and had kilobytes of RAM, but these days should really only be used for special purposes like 3D graphics and neural net simulations where performance is still critical.
I don't see any alternative. When I do computations on paper that involve values measured with some uncertainty, I essentially use base 10 floating point.
_If you're in the right situation_ those eccentricities do not matter. It doesn't matter to me that I can't represent exactly 2/3 in decimal floating point -- the value I'm going to e.g. multiply that 2/3 with in a few moments anyway comes from a measurement with some relative error, so I can just choose appropriately accurate representation of 2/3.
@robryk @jannem @b0rk Support for fractions is also woefully lacking from most programming languages.
Ruby is one of the examples that has them:
irb(main):006:0> 4/5r * 2/3r
=> (8/15)