You mean the double comparison use doubleToLongBits, in that case, 
  value record Box(double value);

  new Box(0.0) == new Box(-1 * 0.0)  // false

which is not better.

Rémi

----- Mail original -----
> De: "Brian Goetz" <brian.go...@oracle.com>
> À: "Remi Forax" <fo...@univ-mlv.fr>, "John Rose" <john.r.r...@oracle.com>
> Cc: "valhalla-spec-experts" <valhalla-spec-experts@openjdk.java.net>
> Envoyé: Jeudi 21 Février 2019 14:33:06
> Objet: Re: acmp again !

>> NaN is interesting because it creates another corner case where the == will 
>> be
>> surprising if it's implemented has a component wise comparison,
>>    value record Box(double value);
>>
>>    var box = new Box(Double.NaN);
>>    box == box   // false
>>
>> so both semantics are not reflective.
> 
> Go re-read the definition of substitutibility, you'll see that indeed it
> is reflexive.  (Even though `==` on double is not.)   So you'll need to
> find another counterexample :)

Reply via email to