Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int DecimalToBCD(int Decimal) {
- return (((Decimal / 10) << 4) | (Decimal % 10));
- }
- int BCDToDecimal(int BCD) {
- return (((BCD >> 4) * 10) + (BCD & 0xF));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement