"Krypto" <[EMAIL PROTECTED]> writes: > The correct answer as told to me by a person is > > (N>>3) + ((N-7*(N>>3))>>3) > > > The above term always gives division by 7
Well, not exactly: [GCC 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> def f(N): return (N>>3) + ((N-7*(N>>3))>>3) ... >>> f(7) 0 >>> f(70) 9 >>> f(700) 98 -- http://mail.python.org/mailman/listinfo/python-list