Module typed_operations

Source

Functionsยง

typed_add
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.
typed_div
Divides two Felt252 values according to the specified OpcodeExtension and returns the result as a Felt252 value. If the OpcodeExtension is Stone it divides them as Felts. If the OpcodeExtension is QM31Operation it divides them as packed reduced QM31 elements.
typed_mul
Multiplies two MaybeRelocatable values according to the specified OpcodeExtension and returns the result as a MaybeRelocatable value. Requires both operands to be Int. If the OpcodeExtension is Stone it multiplies them as Felts. If the OpcodeExtension is QM31Operation it multiplies them as packed reduced QM31 elements.
typed_sub
Substracts two MaybeRelocatable values according to the specified OpcodeExtension and returns the result as a MaybeRelocatable value. If the OpcodeExtension is Stone it subtracts them as MaybeRelocatable::sub does. If the OpcodeExtension is QM31Operation it requires them both to be Int and it subtracts them as packed reduced QM31 elements.