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

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

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

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

        $operand = $operands[0];

        return new QtiFloat(floatval($operand->getValue()));
    }
public function process()
    {
        $operands = $this->getOperands();

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

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

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

        $operand = $operands[0];

        return new QtiFloat(floatval($operand->getValue()));
    }
public function process ( ) { $ operands = $ this -> getOperands ( ) ; if ( $ operands -> containsNull ( ) === true ) { return null ; } if ( $ operands -> exclusivelySingle ( ) === false ) { $ msg = "The IntegerToFloat operator only accepts operands with a single cardinality." ; throw new OperatorProcessingException ( $ msg , $ this , OperatorProcessingException :: WRONG_CARDINALITY ) ; } if ( $ operands -> exclusivelyInteger ( ) === false ) { $ msg = "The IntegerToFloat operator only accepts operands with baseType integer." ; throw new OperatorProcessingException ( $ msg , $ this , OperatorProcessingException :: WRONG_BASETYPE ) ; } $ operand = $ operands [ 0 ] ; return new QtiFloat ( floatval ( $ operand -> getValue ( ) ) ) ; }
Process the IntegerToFloat operator.

@return float|null A float value with the same numeric value as the sub-expression or NULL if the sub-expression is considered to be NULL.
@throws \qtism\runtime\expressions\operators\OperatorProcessingException
Process the IntegerToFloat operator .