Class ArithmeticEngine

java.lang.Object
freemarker.core.ArithmeticEngine
Direct Known Subclasses:
ArithmeticEngine.BigDecimalEngine, ArithmeticEngine.ConservativeEngine

public abstract class ArithmeticEngine extends Object
Used for implementing the arithmetic operations and number comparisons in the template language. The concrete implementation is plugged into the configuration with the arithmetical_engine setting. (See Configurable.setArithmeticEngine(ArithmeticEngine).)
  • Field Details

    • BIGDECIMAL_ENGINE

      public static final ArithmeticEngine.BigDecimalEngine BIGDECIMAL_ENGINE
      Arithmetic engine that converts all numbers to BigDecimal and then operates on them, and also keeps the result as a BigDecimal. This is FreeMarker's default arithmetic engine.
    • CONSERVATIVE_ENGINE

      public static final ArithmeticEngine.ConservativeEngine CONSERVATIVE_ENGINE
      Arithmetic engine that uses (more-or-less) the widening conversions of Java language to determine the type of result of operation, instead of converting everything to BigDecimal up front.
    • minScale

      protected int minScale
    • maxScale

      protected int maxScale
    • roundingPolicy

      protected int roundingPolicy
  • Constructor Details

    • ArithmeticEngine

      public ArithmeticEngine()
  • Method Details