- public class JdslNumber
- extends java.lang.Object
All operations return downcasted Numbers (most efficient use of
space) and take in downcasted input. 1 and 0 should be Integers.
As long as this class is used for arithmetic operations, we should
have the most efficient use of space and time as we avoid using
BigIntegers as much as possible. Not having downcasted input is
fine, as there have been checks (a comparison) to force a
downcasted result. The checks are made for "int" passed in
accidentally as "Long". Supposedly, there should be no need for
this check, but it is there for "security" purposes, as one
inequality operation is not costly. Note: having an int or long as
a BigInteger won't cause any crashes but will be extremely
inefficient. Any operations that are performed through this class
will remain efficient so it is the user's responsibility to not use
BigIntegers as inputs unless 1) it is necessary, or 2) JdslNumber
returned a BigInteger.
Numbers are implicitly assumed to be either Integers, or Longs, or
BigIntegers. It is the user's responsability not to pass Bytes,
Shorts, Floats, Doubles, or BigDecimals.
- $Id: JdslNumber.java,v 1.1 2000/03/06 21:32:17 lv Exp $
- Masi Oka (mao), Luca Vismara (lv)
|Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait