Module refinery.units.blockwise.neg

Expand source code Browse git
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from . import UnaryOperation


class neg(UnaryOperation):
    """
    Each block of the input data is negated bitwise. This is sometimes
    also called the bitwise complement or inverse.
    """
    def operate(self, a): return ~a
    def inplace(self, a): a ^= self.fmask

Classes

class neg (bigendian=False, blocksize=1)

Each block of the input data is negated bitwise. This is sometimes also called the bitwise complement or inverse.

Expand source code Browse git
class neg(UnaryOperation):
    """
    Each block of the input data is negated bitwise. This is sometimes
    also called the bitwise complement or inverse.
    """
    def operate(self, a): return ~a
    def inplace(self, a): a ^= self.fmask

Ancestors

Methods

def operate(self, a)
Expand source code Browse git
def operate(self, a): return ~a
def inplace(self, a)
Expand source code Browse git
def inplace(self, a): a ^= self.fmask

Inherited members