Function typed_add

Source
pub fn typed_add(
    x: &MaybeRelocatable,
    y: &MaybeRelocatable,
    opcode_extension: OpcodeExtension,
) -> Result<MaybeRelocatable, VirtualMachineError>
Expand description

Adds two MaybeRelocatable values according to the specified OpcodeExtension and returns the result as a MaybeRelocatable value. If the OpcodeExtension is Stone it adds them as MaybeRelocatable::add does. If the OpcodeExtension is QM31Operation it requires them both to be Int and it adds them as packed reduced QM31 elements.