Draft proposal: allow the use of relational operators on Comparable classes (original) (raw)

Mark Mahieu markmahieu at googlemail.com
Tue Mar 17 16:02:54 PDT 2009


On 17 Mar 2009, at 22:12, Joseph D. Darcy wrote:

In BigDecimal, the same numerical value can have multiple representation, such as 100 * 10^0 versus 10 * 10^1 versus 1 * 10^2. These are all "the same" under (compareTo == 0) but are not .equals with each other, making replacement of == with (compareTo == 0) conceptually problematic for another reason than object equality.

10, 10.0, 10.00 not being equals() is the one that I keep seeing
people get caught out by.

Mark



More information about the coin-dev mailing list