"spir" <[email protected]> wrote

PS: in "l>>24 & 255", the & operation is useless, since all 24 higher bits are already thrown away by the shift:

They are not gone however there are still 32 bits in an integer so the top
bits *should* be set to zero. But glitches can occur from time to time...

It is good practice to restrict the range to the 8 bits needed by and'ing with 255
even when you think you should be safe.

--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/



_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to