The epsilon method is useful, but with a fixed epsilon, it will only work properly for a certain range of values.
This is why qFuzzyCompare uses a variable epsilon, depending on the values compared. However, when getting very close to zero, the epsilon becomes zero as well, and it's no longer a fuzzyCompare.
I solved this by writing a wrapper that checks whether both compared values are very close to zero, then add a fixed amount (e.g. 1.0) to both of them. That way, the qFuzzyCompare I call internally never sees values that are close to zero, and works.
One word of warning: When using a fuzzy compare, expect that a value can both be equal and greater/lesser.
For example, when you first have
@if (fuzzyIsEqual(a, b)@
but later realize that all you need is a > b, you might think that you no longer need a fuzzyCompare. Of course you can replace the code with
@if (a > b)@
but this will not trigger in cases when the previous code did, and might cause unexpected results.
Better, in this case to do a
@if (fuzzyIsGreaterOrEqual(a, b)@
(which of course you have to write yourself first)