def count_bcd_digits(bcd):
 count = 0
 while (bcd > 0):
  count += 1
  bcd >>= 4
 return count

def count_bcd_digits ( bcd ) : count = 0 while ( bcd > 0 ) : count += 1 bcd >>= 4 return count
count the number of digits in a bcd value .