Class BigDecTieBreakComparative

All Implemented Interfaces:
PostfixMathCommandI, 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 consistency 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: