Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re^4: Encoding BCD

by Anonymous Monk
on Feb 27, 2009 at 22:48 UTC ( #747044=note: print w/ replies, xml ) Need Help??

in reply to Re^3: Encoding BCD
in thread Encoding BCD

I don't get it - aren't you just encoding it to Hex? That's not the same as BCD is it?

Comment on Re^4: Encoding BCD
Replies are listed 'Best First'.
Re^5: Encoding BCD
by Corion (Pope) on Feb 28, 2009 at 08:32 UTC

    Packed Binary-coded decimals are a subset of hexadecimal numbers, except that their values are to be interpreted differently. But as we're encoding strings that have only decimal digits in them, just treating these decimal digits as hexadecimal digits results in the wanted packed bcd values. If you don't trust it, just look at that the tests return the wanted values.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://747044]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2015-11-29 05:50 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (747 votes), past polls