Peter, That was what I was thinking along the lines of, It's been two years since I finished my CS degree and working in mechanical engineering means I've nearly forgotten it all! :(
Thanks, I'll write a function in my app to handle this... Hugh > >>> (5 + 7) % 10 > 2 > > In this context '%' is called 'modulo operator'. What John and Marc > suggested is basically the same operation for the special case of binary > numbers, i. e. > > a % b == a & (b-1) > > if a >= 0 and b == 2**N. > > Peter -- http://mail.python.org/mailman/listinfo/python-list