bcdToDec and DecToBcd

Could you explain a little bit about how they work? They both return a uint8_t[byte], I'm a bit confused about the calculation that just seems to be floating out there. Is that legal? Will those work on non single digit numbers, like say 42. I think I understand the BCD format, I'm just not sure I understand the syntax