Interface NumberObject

All Superinterfaces:
Comparable<NumberObject>, SymbolicObject

public interface NumberObject extends SymbolicObject, Comparable<NumberObject>
A symbolic object wrapping a single instance of Number.
  • Method Details

    • getNumber

      Number getNumber()
      Get the underlying Number.
      Returns:
      the Number wrapped by this object
    • signum

      int signum()
      Returns either -1, 0, or +1, depending on whether the value of this expression is invalid input: '<'0, 0, or >0 (respectively).
    • isZero

      boolean isZero()
      Convenience method to determine whether this concrete expression is 0. Works for integer or real types.
    • isOne

      boolean isOne()
      Convenience method to determine whether this concrete expression is 1. Works for integer or real types.
    • isInteger

      boolean isInteger()
      Does the number have integer type? (Note: a rational number which is integer, e.g., "2/1", does not have integer type.)
      Returns:
      true iff the number has integer type
    • isReal

      boolean isReal()
      Does the number have real (not integer) type?
      Returns:
      true iff the number is real