Thread Links Date Links
Thread Prev Thread Next Thread Index Date Prev Date Next Date Index

Re: Exceptions vs NaN/NaI



On 2012-05-08 22:12:36 -0700, Dmitry Nadezhin wrote:
> Ok. I thought a little how "ComparablePlusNaN" could look like.
> It seems that it is not necessary to invent new interface.
> It is possible to extend a liitle the specification of existing
> "Comparble" and "Comparator" interfaces.
> They method "int Comparator.compare(T x1, T x2)" will continue to
> return -1,+0,+1 when lt(x1,x2), eq(x1,x2), gt(x1,x2).
> The extension is that this method may "throw new UnorderedExcpetion();"
> when x1 and x2 are unordered.
> 
> There is a form to "ask the architects of the JVM".
> It is Java Enhanced Proposal (JEP) http://openjdk.java.net/jeps/1 .
> I attach a draft of a proposal, that enables interoperability
> between different subclasses of java.lang.Number . I beleive that
> this JEP (if accepted) will help to future JVM implementations of
> IEEE 754 number formats (like Binary128) and P1788 Intervals.

What would the behavior be on signed zeroes? Would -0 and +0 be
regarded as equal? (For the set and order theory, <= would no longer
be an order relation on comparable values as it isn't antisymmetric,
but one could consider an order relation on equivalence classes,
where -0 and +0 would be in the same class.)

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)