.. _getvalue:

		Get the signed value of the Integer, truncate it and handle Overflows.

def getvalue(self):
		"""
		.. _getvalue:

		Get the signed value of the Integer, truncate it and handle Overflows.
		"""
		bitset = [0] * self.width
		zero = [1] * self.width

		for shift in range(self.width):
			bitset[shift] = (self._value & (1 << shift)) >> shift
		sign = 0
		if((not bitset[-1]) and self._sign):
			bitset[-1] = 1
			sign = 1
		elif(bitset[-1]):
			bitset = bitsetxor(bitset, zero)
			sign = 1
		
		value = [ bitset[shift] << shift for shift in range(self.width - 1)]
		value = sum(value)
		if(sign):
			return -1 * value
		return value