(self)
return self
Negate in-place.
Negate in-place.
Negate in - place .
def ineg(self):
        """Negate in-place."""
        if self._buffer == b'\x00\x80':
            raise error.BASICError(error.OVERFLOW)
        lsb = (bytearray(self._buffer)[0] ^ 0xff) + 1
        msb = bytearray(self._buffer)[1] ^ 0xff
        # apply carry
        if lsb > 0xff:
            lsb -= 0x100
            msb += 1
        # ignore overflow, since -0 == 0
        self._buffer[:] = bytearray([lsb, msb & 0xff])
        return self
def ineg ( self ) : if self . _buffer == b'\x00\x80' : raise error . BASICError ( error . OVERFLOW ) lsb = ( bytearray ( self . _buffer ) [ 0 ] ^ 0xff ) + 1 msb = bytearray ( self . _buffer ) [ 1 ] ^ 0xff # apply carry if lsb > 0xff : lsb -= 0x100 msb += 1 # ignore overflow, since -0 == 0 self . _buffer [ : ] = bytearray ( [ lsb , msb & 0xff ] ) return self