(self, rhs)
return self
Add another Integer in-place.
Add another Integer in-place.
Add another Integer in - place .
def iadd(self, rhs):
        """Add another Integer in-place."""
        lsb = bytearray(self._buffer)[0] + bytearray(rhs._buffer)[0]
        msb = bytearray(self._buffer)[1] + bytearray(rhs._buffer)[1]
        # apply carry
        if lsb > 0xff:
            lsb -= 0x100
            msb += 1
        # overflow if signs were equal and have changed
        if (
                (bytearray(self._buffer)[1] > 0x7f) ==
                (bytearray(rhs._buffer)[1] > 0x7f) !=
                (msb > 0x7f)
            ):
            raise error.BASICError(error.OVERFLOW)
        self._buffer[:] = bytearray([lsb, msb & 0xff])
        return self
def iadd ( self , rhs ) : lsb = bytearray ( self . _buffer ) [ 0 ] + bytearray ( rhs . _buffer ) [ 0 ] msb = bytearray ( self . _buffer ) [ 1 ] + bytearray ( rhs . _buffer ) [ 1 ] # apply carry if lsb > 0xff : lsb -= 0x100 msb += 1 # overflow if signs were equal and have changed if ( ( bytearray ( self . _buffer ) [ 1 ] > 0x7f ) == ( bytearray ( rhs . _buffer ) [ 1 ] > 0x7f ) != ( msb > 0x7f ) ) : raise error . BASICError ( error . OVERFLOW ) self . _buffer [ : ] = bytearray ( [ lsb , msb & 0xff ] ) return self