Class MathematicalContext

java.lang.Object
de.espirit.firstspirit.access.template.MathematicalContext

public final class MathematicalContext extends Object
Context container definition for a mathematical context, allowing to define the precision of mathematical computation within an evaluation process.
Since:
4.1.16
  • Field Details

    • DEFAULT_MATH_CONTEXT

      public static final MathContext DEFAULT_MATH_CONTEXT
      A default context.
      Since:
      4.1.16
  • Constructor Details

    • MathematicalContext

      public MathematicalContext()
      Constructor using the default context.
      Since:
      4.1.16
  • Method Details

    • getMathContext

      @NotNull public @NotNull MathContext getMathContext()
      Provides the defined mathematical context.
      Since:
      4.1.16
    • setMathContext

      public void setMathContext(@NotNull @NotNull MathContext value)
      Sets the matthematical context.#
      Parameters:
      value - The context to use.
      Since:
      4.1.16
    • setPrecision

      public void setPrecision(int precision)
      Set precision, see MathContext.getPrecision().
      Parameters:
      precision - a value between 0 and Integer.MAX_VALUE
      Since:
      4.1.16
    • setRoundingMode

      public void setRoundingMode(@NotNull @NotNull RoundingMode mode)
      Sets the rounding mode for this context.
      Parameters:
      mode - The rounding mode.
      Since:
      4.1.16
    • useDefault

      public void useDefault()
      Reset to default: DEFAULT_MATH_CONTEXT.
      Since:
      4.1.16