protected static NumberValue divide(NumberValue dividend, NumberValue divisor, MathContext context) {
        if (Objects.isNull(dividend)) {
            throw new ArithmeticException("The dividend cannot be null");
        }
        if (Objects.isNull(divisor)) {
            throw new ArithmeticException("The divisor cannot be null");
        }
        return new DefaultNumberValue(
                dividend.numberValueExact(BigDecimal.class).divide(divisor.numberValue(BigDecimal.class), context));
    }
protected static NumberValue divide ( NumberValue dividend , NumberValue divisor , MathContext context ) { if ( Objects . isNull ( dividend ) ) { throw new ArithmeticException ( "The dividend cannot be null" ) ; } if ( Objects . isNull ( divisor ) ) { throw new ArithmeticException ( "The divisor cannot be null" ) ; } return new DefaultNumberValue ( dividend . numberValueExact ( BigDecimal . class ) . divide ( divisor . numberValue ( BigDecimal . class ) , context ) ) ; }
A protected helper method to divide 2 {@link NumberValue} types.<br>
If either of the values is <code>null</code> an {@link ArithmeticException} is thrown.

@param dividend the first value to be divided
@param divisor  the value to be divided by
@param context  the {@link MathContext} to use
@return the result of the division as {@link NumberValue}