Proposal: Sameness operators
Joe.Darcy at Sun.COM
Thu Apr 2 16:13:36 PDT 2009
Mark Thornton wrote:
> Reinier Zwitserloot wrote:
>> BI/BD's comparison methods can't just convert the incoming primitive
>> to a BI/BD, because NaN and the infinities don't convert, yet the
>> answer to this expression:
>> Double.NEGATIVE_INFINITY < BigInteger.ZERO
>> should clearly be true. The above plan can make that happen by adding
>> more logic to BI/BD's compareTo methods.
> The 754R decimal format does include NaN and +-infinite, so perhaps the
> answer here is to modify Java's BigDecimal to match.
Yes, I actually worked on incorporating the decimal changes into the
754R draft while I was editor :-) The "preferred exponent" nomenclature
in the new 754 standard came from the JSR 13 BigDecimal specification
work in JDK 5.
> Joe could probably tell us more about the possibility of such a change.
We don't plan to add the non-finite values and negative zero to the set
of values recognized by BigDecimal. If someone wanted to do this, I'd
recommend creating a wrapper around BigDecimal that supported the new
values and otherwise delegated to an internal BigDecimal.
More information about the coin-dev