[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] hex masks (was: PowerMate )
From: |
cswiger |
Subject: |
Re: [Discuss-gnuradio] hex masks (was: PowerMate ) |
Date: |
Wed, 18 May 2005 18:02:34 -0400 (EDT) |
On Wed, 18 May 2005, Eric Blossom wrote:
> We probably just need a single python function that takes these hex
> constants and conditionally converts them to negative ints.
maybe something like:
mask = 0x80ff4506
if ( mask == sys.maxint + 1 ) | ( mask > 2 * sys.maxint + 1):
return error # 0x8000000 can't be made an int no way no how
# and reject anything over 0xffffffff
if mask > sys.maxint:
mask = -int ( 2 * sys.maxint + 2 - mask )
--Chuck