Package freemarker.core
Class ArithmeticEngine.BigDecimalEngine
java.lang.Object
freemarker.core.ArithmeticEngine
freemarker.core.ArithmeticEngine.BigDecimalEngine
- Enclosing class:
- ArithmeticEngine
This is the default arithmetic engine in FreeMarker. It converts every
number it receives into
BigDecimal, then operates on these
converted BigDecimals.-
Nested Class Summary
Nested classes/interfaces inherited from class freemarker.core.ArithmeticEngine
ArithmeticEngine.BigDecimalEngine, ArithmeticEngine.ConservativeEngine -
Field Summary
Fields inherited from class freemarker.core.ArithmeticEngine
BIGDECIMAL_ENGINE, CONSERVATIVE_ENGINE, maxScale, minScale, roundingPolicy -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcompareNumbers(Number first, Number second)Should be able to parse all FTL numerical literals, Java Double toString results, and XML Schema numbers.Methods inherited from class freemarker.core.ArithmeticEngine
setMaxScale, setMinScale, setRoundingPolicy
-
Constructor Details
-
BigDecimalEngine
public BigDecimalEngine()
-
-
Method Details
-
compareNumbers
- Specified by:
compareNumbersin classArithmeticEngine
-
add
- Specified by:
addin classArithmeticEngine
-
subtract
- Specified by:
subtractin classArithmeticEngine
-
multiply
- Specified by:
multiplyin classArithmeticEngine
-
divide
- Specified by:
dividein classArithmeticEngine
-
modulus
- Specified by:
modulusin classArithmeticEngine
-
toNumber
Description copied from class:ArithmeticEngineShould be able to parse all FTL numerical literals, Java Double toString results, and XML Schema numbers. This means these should be parsed successfully, except if the arithmetical engine couldn't support the resulting value anyway (such as NaN, infinite, even non-integers):-123.45,1.5e3,1.5E3,0005,+0,-0,NaN,INF,-INF,Infinity,-Infinity.- Specified by:
toNumberin classArithmeticEngine
-