public function process()
    {
        $operands = $this->getOperands();

        if ($operands->containsNull() === true) {
            return null;
        }

        if ($operands->exclusivelySingle() === false) {
            $msg = "The IntegerDivide operator only accepts operands with single cardinality.";
            throw new OperatorProcessingException($msg, $this, OperatorProcessingException::WRONG_CARDINALITY);
        }

        if ($operands->exclusivelyInteger() === false) {
            $msg = "The IntegerDivide operator only accepts operands with baseType integer.";
            throw new OperatorProcessingException($msg, $this, OperatorProcessingException::WRONG_BASETYPE);
        }

        $operand1 = $operands[0];
        $operand2 = $operands[1];

        if ($operand2->getValue() == 0) {
            // division by zero forbidden.
            return null;
        }

        return new QtiInteger(intval(floor($operand1->getValue() / $operand2->getValue())));
    }
public function process()
    {
        $operands = $this->getOperands();

        if ($operands->containsNull() === true) {
            return null;
        }

        if ($operands->exclusivelySingle() === false) {
            $msg = "The IntegerDivide operator only accepts operands with single cardinality.";
            throw new OperatorProcessingException($msg, $this, OperatorProcessingException::WRONG_CARDINALITY);
        }

        if ($operands->exclusivelyInteger() === false) {
            $msg = "The IntegerDivide operator only accepts operands with baseType integer.";
            throw new OperatorProcessingException($msg, $this, OperatorProcessingException::WRONG_BASETYPE);
        }

        $operand1 = $operands[0];
        $operand2 = $operands[1];

        if ($operand2->getValue() == 0) {
            // division by zero forbidden.
            return null;
        }

        return new QtiInteger(intval(floor($operand1->getValue() / $operand2->getValue())));
    }
public function process ( ) { $ operands = $ this -> getOperands ( ) ; if ( $ operands -> containsNull ( ) === true ) { return null ; } if ( $ operands -> exclusivelySingle ( ) === false ) { $ msg = "The IntegerDivide operator only accepts operands with single cardinality." ; throw new OperatorProcessingException ( $ msg , $ this , OperatorProcessingException :: WRONG_CARDINALITY ) ; } if ( $ operands -> exclusivelyInteger ( ) === false ) { $ msg = "The IntegerDivide operator only accepts operands with baseType integer." ; throw new OperatorProcessingException ( $ msg , $ this , OperatorProcessingException :: WRONG_BASETYPE ) ; } $ operand1 = $ operands [ 0 ] ; $ operand2 = $ operands [ 1 ] ; if ( $ operand2 -> getValue ( ) == 0 ) { // division by zero forbidden. return null ; } return new QtiInteger ( intval ( floor ( $ operand1 -> getValue ( ) / $ operand2 -> getValue ( ) ) ) ) ; }
Process the IntegerDivide operator.

@return integer|null An integer value that corresponds to the first expression divided by the second rounded down to the greatest integer i such that i <= x / y. If the second expression is 0 or if either of the sub-expressions is NULL, the result is NULL.
Process the IntegerDivide operator .