public class MathUtil extends Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_DECIMAL_EXPANSION_SCALE
The default expansion scale used in division operations resulting in a decimal value with non-terminating decimal
expansion.
|
Constructor and Description |
---|
MathUtil() |
Modifier and Type | Method and Description |
---|---|
static Literal |
compute(Literal leftLit,
Literal rightLit,
MathExpr.MathOp op)
Computes the result of applying the supplied math operator on the supplied left and right operand.
|
static int |
getDecimalExpansionScale()
Returns the decimal expansion scale used in division operations resulting in a decimal value with non-terminating
decimal expansion.
|
static void |
setDecimalExpansionScale(int decimalExpansionScale)
Sets the decimal expansion scale used in divisions resulting in a decimal value with non-terminating decimal
expansion.
|
public static final int DEFAULT_DECIMAL_EXPANSION_SCALE
public static Literal compute(Literal leftLit, Literal rightLit, MathExpr.MathOp op) throws ValueExprEvaluationException
leftLit
- a numeric datatype literalrightLit
- a numeric datatype literalop
- a mathematical operator, as definied by MathExpr.MathOp.ValueExprEvaluationException
public static int getDecimalExpansionScale()
public static void setDecimalExpansionScale(int decimalExpansionScale)
decimalExpansionScale
- The decimal expansion scale to set. Note that a mimimum of 18 is required to stay
compliant with the XPath specification of xsd:decimal operations.Copyright © 2015-2019 Eclipse Foundation. All Rights Reserved.