com.rubecula.jquantity
Interface Arithmetical

All Known Subinterfaces:
Integral
All Known Implementing Classes:
BaseNumber, Manifest, WholeNumber

public interface Arithmetical

Interface to define certain standard Arithmetical accessor methods.

Since:
V_0_1
Version:
$Revision: 1.2 $
Author:
Robin Hillyard

Method Summary
 boolean isInfinite()
          Method to determine if an arithmetical object is infinite.
 boolean isInteger()
          Method determines if it is safe and appropriate to convert this arithmetical object into BigInteger.
 boolean isUnity()
          Method to determine if this arithmetical object has the value of 1.
 int signum()
          Method to find the sign of the magnitude of this arithmetical object.
 

Method Detail

isInfinite

public boolean isInfinite()
Method to determine if an arithmetical object is infinite.

Returns:
true if object is infinite in value.

isInteger

public boolean isInteger()
Method determines if it is safe and appropriate to convert this arithmetical object into BigInteger.

Returns:
true if value is an exact integer. NOTE: even if this method returns true, it is not necessarily the case that the intValue() can be called without loss of precision.

isUnity

public boolean isUnity()
Method to determine if this arithmetical object has the value of 1.

Returns:
true if value is 1.

signum

public int signum()
Method to find the sign of the magnitude of this arithmetical object.
Note that this method knows nothing of fuzziness or typed values and will generally report the sign of the object as it appears (exception: Complex objects which have no inherent sign unless converted to Cartesian form).

Returns:
0 if value is 0; 1 if value is positive; -1 if value is negative.