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

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

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

        if ($operands->exclusivelyNumeric() === false) {
            $msg = "The Power operator only accepts operands with a baseType of integer or float.";
            throw new OperatorProcessingException($msg, $this, OperatorProcessingException::WRONG_BASETYPE);
        }

        $operand1 = $operands[0];
        $operand2 = $operands[1];
        $raised = pow($operand1->getValue(), $operand2->getValue());

        if (is_nan($raised)) {
            return null;
        }

        // If the first operand was not 0 but the result is 0, it means
        // we are subject to a lower overflow.
        if ($operand1->getValue() != 0 && $raised == 0) {
            return null;
        }

        // If the first and the second operands are not infinite but the result is infinite
        // it means we are subject to an upper overflow.
        if (!is_infinite($operand1->getValue()) && !is_infinite($operand2->getValue()) && is_infinite($raised)) {
            return null;
        }

        // pow() returns integers as much as it can, so we must cast.
        // If the casted value cannot be contained in a float, we are
        // subject to an overflow/underflow.
        $floatval = floatval($raised);
        if ($raised != 0 && $floatval == 0) {
            // underflow
            return null;
        } elseif (!is_infinite($raised) && is_infinite($floatval)) {
            // overflow
            return null;
        } else {
            return new QtiFloat($floatval);
        }
    }