On Feb 6, 3:29 pm, [EMAIL PROTECTED] wrote:
> On Feb 1, 8:25 pm, "Krypto" <[EMAIL PROTECTED]> wrote:
>
> > 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
>
> Does anybody else notice that this breaks the spirit of the problem
> (regardless of it's accuracy)? 'N-7' uses the subtraction operator,
> and is thus an invalid solution for the original question.
>
[snip]
Instead of subtraction you can use complement-and-add: N + ~7 + 1
(that's a tilde '~' not a minus '-').

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to