Class Comparative

  • All Implemented Interfaces:
    PostfixMathCommandI, java.io.Serializable
    Direct Known Subclasses:
    BigDecRelational, MatrixCmp, NullSafeEquals

    public class Comparative
    extends BinaryFunction
    Implements the comparative operations <, >, <=, >=, != and ==. The <, >, <=, >= operators only work on Double type, while the != and == operators also work on String and Vector arguments. For other types, care might be needed.

    Complex numbers are compared using a tolerance which can be set using setTolerance().

    Since:
    2.3.0 beta 1 a bit of a rewrite to make sub classing easier, now allows Complex to be compared to Double i.e. 1+0 i == 1., 2.3.0 beta 2 changed the internal lt,gt,le,ge,ne and eq method to return boolean. If this breaks anything use if (lt(obj1,obj2)) inStack.push(Double.valueOf(1)); else inStack.push(Double.valueOf(0));
    Author:
    N Funk and R Morris
    See Also:
    Serialized Form