def simple_unary_op(func): specialize.argtype(1)(func) @functools.wraps(func) def dispatcher(self, v): return self.box(func(self, self.for_computation(self.unbox(v)))) return dispatcher
def raw_binary_op(func): specialize.argtype(1, 2)(func) @functools.wraps(func) def dispatcher(self, v1, v2): return func(self, self.for_computation(self.unbox(v1)), self.for_computation(self.unbox(v2)) ) return dispatcher
def raw_unary_op(func): specialize.argtype(1)(func) @functools.wraps(func) def dispatcher(self, v): return func( self, self.for_computation(self.unbox(v)) ) return dispatcher
def raw_binary_op(func): specialize.argtype(1, 2)(func) @functools.wraps(func) def dispatcher(self, v1, v2): return func(self, self.for_computation(self.unbox(v1)), self.for_computation(self.unbox(v2))) return dispatcher
def make_float_unpacker(size): return specialize.argtype(0)( lambda fmtiter: fmtiter.appendobj(ieee.unpack_float( fmtiter.read(size), fmtiter.bigendian)))
def make_float_unpacker(size): return specialize.argtype(0)(lambda fmtiter: fmtiter.appendobj( ieee.unpack_float(fmtiter.read(size), fmtiter.bigendian)))