It is likely because equals is usually “object equals”, not necessarily “math equals”. Since the internal representation is different, the objects are indeed different. Tricky though, and most 3rd party code would likely choose to make equals true in this kind of situation.
Java has tons of examples where the core behavior is logically correct, but VERY unintuitive - I feel the pain daily.
Java has tons of examples where the core behavior is logically correct, but VERY unintuitive - I feel the pain daily.