Python plugin

Samuel A. Falvo II kc5tja at garnet.armored.net
Mon Jan 10 16:30:57 EST 2000


In article <3877E637.D3C9CC11 at callware.com>, Ivan Van Laningham wrote:
>the engine use two's complement arithmetic.  For example, to get a
>32-bit 0xFFFFFFFF, we had to assign -1 to each individual byte.  Other
>opcodes were more complex.

To be fair, Python isn't without its numerical faults either.  For example:

>>> data = string.atol( stringArgument[0:8] )
>>> print "%08lX" % (data)

will fault on any integral value greater than 0x7FFFFFFF.  Why?  Because
Python just plain can't understand the concept of an unsigned integer.  So,
I had to cheat:

>>> print "%04lX%04lX" % ( data >> 16, data & 0xFFFF )

So much for portability and convenience.  :)

-- 
KC5TJA/6, DM13, QRP-L #1447
Samuel A. Falvo II
Oceanside, CA



More information about the Python-list mailing list