Binary number manipulation

Georgy Pruss see_signature__ at hotmail.com
Wed Dec 3 07:02:13 EST 2003


"Tim Roberts" <timr at probo.com> wrote in message news:350rsvkbsht8rgs1fsjjc7vkktf87sahi7 at 4ax.com...
| SBrunning at trisystems.co.uk wrote:
| >
| >> 2. If 1 is no, does that mean that I need to do all the manipulation in
| >> some icky string format and then go back?
| >
| >I use:
| >
| >((high << 16) | low)
|
| ...which, unfortunately, gives a FutureWarning in Python 2.3 if high
| happens to be larger than 32767.

Yes, it's really annoying. I use (high * 65536 + low) instead.

-Georgy






More information about the Python-list mailing list