BCD List to HEX List

Paul Rubin http
Sun Jul 30 19:08:21 EDT 2006


Philippe Martin <pmartin at snakecard.com> writes:
> Thanks John, I do not have a long available on the device: stuck with 16
> bits.

Oh, I think I understand now, why you were asking about algorithms.
You really did want something whose intermediate results all fit in 16
bits.  

Even if your C compiler doesn't support a long int datatype, it may
have some library functions to do long arithmetic.  Look for functions
with names like lmul, ldiv, etc.

Will the decimal digit strings always be 8 digits?  If yes, there are
probably a few math tricks you can use to do the hex conversion
simply.  



More information about the Python-list mailing list