brillig_vm::arithmetic

Function evaluate_binary_int_op_arith

Source
fn evaluate_binary_int_op_arith<T: WrappingAdd + WrappingSub + WrappingMul + CheckedDiv + BitAnd<Output = T> + BitOr<Output = T> + BitXor<Output = T>>(
    op: &BinaryIntOp,
    lhs: T,
    rhs: T,
) -> Result<T, BrilligArithmeticError>
Expand description

Evaluates arithmetic or bitwise operations on unsigned integer types, using wrapping arithmetic for add, sub, and mul.

§Returns

§Panics

If there an operation other than Add, Sub, Mul, Div, And, Or, Xor is supplied as an argument.