PROPOSAL: Sameness operators (version 2)

Mark Thornton mthornton at optrak.co.uk
Fri May 1 00:38:56 PDT 2009


Derek Foster wrote:
> and adds additional overloadings to existing operators:
> a < b     a.compareTo(b) < 0, or a < b for primitive types.
> a > b     a.compareTo(b) > 0, or a > b for primitive types.
>
>   
0f < Float.NaN is false

Float.valueOf(0).compareTo(Float.valueOf(Float.NaN)) < 0 is true

With Float objects, would the values be unboxed and then compared using 
the existing '<' operator or left boxed and compared using compareTo? If 
the former, then casting to Comparable would change the result, while 
the second alternative would change the current result (obtained via 
autounboxing).

Mark Thornton




More information about the coin-dev mailing list