MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / bitwise_op

Method bitwise_op

compiler/src/modules/vm/ops.rs:130–135  ·  view source on GitHub ↗
(&mut self, a: Val, b: Val, op: impl Fn(i128, i128) -> i128)

Source from the content-addressed store, hash-verified

128 }
129
130 pub fn bitwise_op(&mut self, a: Val, b: Val, op: impl Fn(i128, i128) -> i128) -> Result<Val, VmErr> {
131 let ai = as_i128(a, &self.heap).ok_or(cold_type("bitwise op requires integer operands"))?;
132 let bi = as_i128(b, &self.heap).ok_or(cold_type("bitwise op requires integer operands"))?;
133 let r = op(ai, bi);
134 self.int_to_val(Some(r))
135 }
136
137 /* Clone the element set out of a `set` or `frozenset`; None for any other type. */
138 pub(crate) fn clone_set_items(&self, v: Val) -> Option<ValSet> {

Callers 1

handle_bitwiseMethod · 0.80

Calls 3

as_i128Function · 0.85
cold_typeFunction · 0.85
int_to_valMethod · 0.80

Tested by

no test coverage detected