Comparing numbers is hard

We know that to compare floating point values we should use epsilon and not just compare bits. We may run into similar issues when comparing BigDecimal in Java:

What is the output? Of course it is false, otherwise I wouldn’t write this post. This is because BigDecimal includes scale:

So we should use this:

and then the result is as we expect.