Although the current 1.0a3 release is still an alpha, the interfaces
as defined are expected to change little. There are a couple of issues
concerning the current design and implementation:
-
Class and interface names
IntegerNumber is quite a long name for an interface, but Integer
is already in java.lang and we don't want a naming collision with
that package. On the other hand, naming should be symmetric, so using "Real",
"Rational" and "IntegerNumber" is not an option.
-
Performance
Performance may be an issue. The pow(IntegerNumber) operation
is fairly slow. The sections that check that the argument is not null
should be replaced by a try-catch block that catches NullPointerExceptions.
This will improve performance.
-
Java syntax
The Java syntax is quite restricting in some cases. Though it is conceptually
beautiful to narrow the return type of an overridden method, the Java language
does not permit this. This restriction is recognized, and JavaSoft considers
a change to the language syntax.
-
Rounding
Though the current version does not support various rounding methods,
rounding is critical to JUMP, as we want to display decimal results after
performing some arbitrary precision computation. The implementation of
generic rounding algorithms for say sines and powers are not straightforward.
-
Comparing
How does one compare an logarithm to a sine or a fraction to a power.
The compareTo(RealNumber) in the RealNumber interface
declares that it may throw a CanNotCompareException.
|