(-1)**1000

Michiel Overtoom motoom at xs4all.nl
Wed Oct 22 06:38:56 EDT 2014


On Oct 22, 2014, at 12:29, Peter Otten wrote:

> That looks like log(a) while a parity check takes constant time:
> $ python3 -m timeit -s 'a = 10**10' 'a & 1'


Do you mean 'parity' as in http://en.wikipedia.org/wiki/Parity_bit ?  Because a parity bit denotes whether the *number* of '1' bits is even or odd, not the value of the least significant bit.

Greetings,

-- 
"You can't actually make computers run faster, you can only make them do less." - RiderOfGiraffes




More information about the Python-list mailing list