[Tutor] Re: BCD Ascii to a binary hex value

Magnus Lycka magnus@thinkware.se
Tue Feb 18 13:37:05 2003


At 12:00 2003-02-18 -0500, tutor-request@python.org wrote:
>I can convert from the BCD ascii for the positive normally using binary =
>and for the negative numbers using twos complement but I do not know how =
>to convert from the binary value to the BCD ASCII just using just a pen =
>and paper as I want to write a program to convert them.
>Just thought you might give me some guidance if you can.

If this is supposed to have anything to do with
python I'd suggest using numeric types as the
path. There are standard python ways of converting
both to and from hexadecimal notation. As I say
so often: look in the python library reference
chapter 2.

http://www.python.org/doc/current/lib/built-in-funcs.html
http://www.python.org/doc/current/lib/typesseq-strings.html



-- 
Magnus Lycka, Thinkware AB
Alvans vag 99, SE-907 50 UMEA, SWEDEN
phone: int+46 70 582 80 65, fax: int+46 70 612 80 65
http://www.thinkware.se/  mailto:magnus@thinkware.se