On 2007-02-01, Michael Yanowitz <[EMAIL PROTECTED]> wrote: > I think it is off by 1 in small numbers, off by a little more with large > numbers: >>>> def div7 (N): > ... return (N>>3) + ((N-7*(N>>3))>>3) > ... >>>> div7 (70) > 9 >>>> div7 (77) > 10 >>>> div7 (700) > 98 >>>> div7 (7) > 0 >>>> div7 (10) > 1 >>>> div7 (14) > 1 >>>> div7 (21) > 2 >>>> div7 (700) > 98 >>>> div7 (7000) > 984 >
Heh, heh. That's reminding of the "fabulous" O(n) Dropsort algorithm I saw linked from Effbot's blog. -- Neil Cerutti I'm tired of hearing about money, money, money, money, money. I just want to play the game, drink Pepsi, wear Reebok. --Shaquille O'Neal -- http://mail.python.org/mailman/listinfo/python-list