fix get_bit docs

This commit is contained in:
jan 2018-04-14 14:34:26 -07:00
parent e2b05d7c86
commit 3d7df45c2b

View File

@ -21,10 +21,10 @@ def is_scalar(var: Any) -> bool:
def get_bit(bit_string: Any, bit_id: int) -> bool: def get_bit(bit_string: Any, bit_id: int) -> bool:
""" """
Returns true iff bit number 'bit_id' from the right of 'bitstring' is 1 Returns true iff bit number 'bit_id' from the right of 'bit_string' is 1
:param bit_string: st :param bit_string: Bit string to test
:param bit_id: :param bit_id: Bit number, 0-indexed from the right (lsb
:return: value of the requested bit (bool) :return: value of the requested bit (bool)
""" """
return bit_string & (1 << bit_id) != 0 return bit_string & (1 << bit_id) != 0