knx_stack/datapointtypes.py
def twos_comp(self, val, bits):
        """compute the 2's complement of int value val"""
        max_mantissa_value = (1 << bits) - 1
        comp_two = abs(max_mantissa_value - val) + 1
        return comp_two
compute the 2's complement of int value val
compute the 2's complement of int value val
compute the 2 ' s complement of int value val
def twos_comp(self, val, bits):
        max_mantissa_value = (1 << bits) - 1
        comp_two = abs(max_mantissa_value - val) + 1
        return comp_two
def twos_comp ( self , val , bits ) : max_mantissa_value = ( 1 << bits ) - 1 comp_two = abs ( max_mantissa_value - val ) + 1 return comp_two
compute the 2's complement of int value val
compute the 2 ' s complement of int value val
"""compute the 2's complement of int value val"""
self
val
bits