Re: [math] Issue with equals/hashCode on Complex/Dfp instances

2014-04-18 Thread Gilles
On Tue, 15 Apr 2014 09:52:08 -0700, Phil Steitz wrote: On 4/15/14, 5:19 AM, Gilles wrote: On Tue, 15 Apr 2014 08:03:51 +0900, Cyrille Artho wrote: Dear all, Java's default contract (in Object) states that two objects with equal data should return the same hashCode. In other words, if a.equals(b

Re: [math] Issue with equals/hashCode on Complex/Dfp instances

2014-04-15 Thread Phil Steitz
On 4/15/14, 5:19 AM, Gilles wrote: > On Tue, 15 Apr 2014 08:03:51 +0900, Cyrille Artho wrote: >> Dear all, >> Java's default contract (in Object) states that two objects with >> equal data should return the same hashCode. In other words, if >> a.equals(b), their return value of hashCode() must be t

Re: [math] Issue with equals/hashCode on Complex/Dfp instances

2014-04-15 Thread Gilles
On Tue, 15 Apr 2014 08:03:51 +0900, Cyrille Artho wrote: Dear all, Java's default contract (in Object) states that two objects with equal data should return the same hashCode. In other words, if a.equals(b), their return value of hashCode() must be the same. Unfortunately, with Double values, ne

[math] Issue with equals/hashCode on Complex/Dfp instances

2014-04-14 Thread Cyrille Artho
Dear all, Java's default contract (in Object) states that two objects with equal data should return the same hashCode. In other words, if a.equals(b), their return value of hashCode() must be the same. Unfortunately, with Double values, new Double(0.0d).equals(new Double(-0.0d)) is false. Thi