I think this website would be a useful place to point people who are confused by the results they get when they compare floating point numbers in their code: https://floating-point-gui.de
I propose we introduce a tag for this. Something along the lines of:
Some fractional numbers cannot be represented exactly as binary floating point numbers. So when comparing floating point numbers it's usually best to include a margin of error: test that they are similar rather than exactly equal.
Instead of:
Try:
if abs(x - y) < epsilon:
...
Where epsilon is a small number.
See this website for more information: floating-point-guide.de
I think this website would be a useful place to point people who are confused by the results they get when they compare floating point numbers in their code: https://floating-point-gui.de
I propose we introduce a tag for this. Something along the lines of: