Package com.singularsys.jep.bigdecimal.functions

# Class BigDecDiv

java.lang.Object
com.singularsys.jep.functions.PostfixMathCommand
com.singularsys.jep.functions.BinaryFunction
com.singularsys.jep.functions.Divide
com.singularsys.jep.bigdecimal.functions.BigDecDiv

All Implemented Interfaces:
  `FixedPrecisionFunctionI`, `PostfixMathCommandI`, `RealBinaryFunction`, `Serializable`

public class BigDecDiv extends Divide implements FixedPrecisionFunctionI
Division function for BigDecimals, Double and other Number types. Uses `BigDecimal.divide(BigDecimal, MathContext)` for BigDecimals.

Since Jep 4.1 can work with vectors.

See Also:
  - Serialized Form

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class com.singularsys.jep.functions.BinaryFunction

  `BinaryFunction.BiFunctionWithException<T>`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected MathContext`
  `mc`
  `protected int`
  `scale`

  ### Fields inherited from class com.singularsys.jep.functions.PostfixMathCommand

  `curNumberOfParameters, description, name, NaN, numberOfParameters`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `BigDecDiv(MathContext mc)`
  `BigDecDiv(MathContext mc, int scale)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Object`
  `div(Object l, Object r)`
  `int`
  `getDecimalPlaces()`
  Gets the number of decimal places used.
  `MathContext`
  `getMathContext()`
  `void`
  `setDecimalPlaces(int scale)`
  Sets the number of decimal places to use.
  `void`
  `setMathContext(MathContext mc)`

  ### Methods inherited from class com.singularsys.jep.functions.Divide

  `div, div, div, div, div, eval, evaluate`

  ### Methods inherited from class com.singularsys.jep.functions.BinaryFunction

  `instanceOf, instanceOf, instanceOf, instanceOf, run`

  ### Methods inherited from class com.singularsys.jep.functions.PostfixMathCommand

  `asArray, asBool, asDouble, asInt, asLong, asStrictInt, asString, asType, checkNumberOfParameters, getDescription, getDescription, getDescriptionWithType, getName, getNumberOfParameters, setCurNumberOfParameters, setDescription, setName, toString, toString`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### mc

    protected MathContext mc

  - ### scale

    protected int scale

- ## Constructor Details

  - ### BigDecDiv

    public BigDecDiv(MathContext mc)
    Parameters:
      `mc` -

  - ### BigDecDiv

    public BigDecDiv(MathContext mc, int scale)

- ## Method Details

  - ### getMathContext

    public MathContext getMathContext()

  - ### setMathContext

    public void setMathContext(MathContext mc)

  - ### div

    public Object div(Object l, Object r) throws EvaluationException
    Overrides:
      `div` in class `Divide`
    Throws:
      `EvaluationException`

  - ### setDecimalPlaces

    public void setDecimalPlaces(int scale)
    Description copied from interface: `FixedPrecisionFunctionI`
    Sets the number of decimal places to use.
    Specified by:
      `setDecimalPlaces` in interface `FixedPrecisionFunctionI`
    Parameters:
      `scale` - either zero, a positive number or -1 for floating-point formats

  - ### getDecimalPlaces

    public int getDecimalPlaces()
    Description copied from interface: `FixedPrecisionFunctionI`
    Gets the number of decimal places used.
    Specified by:
      `getDecimalPlaces` in interface `FixedPrecisionFunctionI`
    Returns:
      either zero, a positive number or -1 for floating-point formats