Class BigDecTieBreakComparative

  • All Implemented Interfaces:
    PostfixMathCommandI, java.io.Serializable

    public class BigDecTieBreakComparative
    extends BigDecRelational
    A version of the comparative operator which breaks ties between two BigDecimal numbers representing the same value with different precisions, here for the LT operation 2.0 < 2.00 and for the GT operation 2.00 > 2.0.

    Its intended this function would be used with the MinMax function and ensures consistancy so min(2.0,2.00)==2.0 and min(2.00,2.0)==2.0 irrespective of the order.

    To use

     jep.addFunction("min",new MinMax(new BigDecTieBreakComparative(BigDecRelational.LT)));
     jep.addFunction("max",new MinMax(new BigDecTieBreakComparative(BigDecRelational.GT)));
     
    See Also:
    MinMax, Serialized Form
    • Constructor Detail

      • BigDecTieBreakComparative

        public BigDecTieBreakComparative​(int id)
        Constructor
        Parameters:
        id - must be either LT or GT
        Throws:
        java.lang.IllegalArgumentException - if id is LE, GE, EQ or NE