Class MathContext
java.lang.Object
me.datafox.dfxengine.values.api.operation.MathContext
- Direct Known Subclasses:
MapMathContext
Context used when applying
Operations on Values and ValueMaps.
convertResultTo() determines the NumeralType that the resulting Numeral should be converted
to after the operation. A null value represents no conversion. It is set to null by default. If
ignoreBadConversion() is true and the conversion could not be done due to the resulting Numeral
being too large for that type, no conversion is done. Otherwise, an ExtendedArithmeticException is thrown.
It is set to true by default. If convertToDecimal() is true, the input and parameter
Numerals are converted to the smallest possible decimal type before the operation. It is set to false by
default.-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
MathContext
public MathContext()
-
-
Method Details
-
convertResultTo
- Returns:
NumeralTypethat the resultingNumeralfrom this operation should be converted to, ornullif no conversion should be done
-
ignoreBadConversion
public boolean ignoreBadConversion()- Returns:
trueif the conversion determined byconvertResultTo()should be ignored when the resultingNumeralfrom this operation if the conversion cannot be done, orfalseif anExtendedArithmeticExceptionshould be thrown instead.
-
convertToDecimal
public boolean convertToDecimal()- Returns:
trueif the input and parameterNumeralsshould be converted to a decimal type before the operation, orfalseotherwise.
-
defaults
- Returns:
- MathContext with default values
-