[Tutor] String formatting hex numbers

Tony Cappellini cappy2112 at gmail.com
Sun May 31 01:19:25 CEST 2009

I was looking at a this code which uses this code to dsiplay some hex numbers

 sys.stdout.write( "\r%-8s ... 0x%08X->0x%08X " % ( descr,
long(startAddr), long(endAddr) )

The hex values are in this range
0x1BFFF400 to 1BFFF000

Why are these displayed with a leading negative sign (between the 0x
and the actual number)- as seen below?

0x-1BFFF400 to 0x-1BFFF000


More information about the Tutor mailing list