> See also http://bugs.python.org/issue3439 > where there's a proposal to expose the _PyLong_NumBits method. This > would give an O(1) solution.
> > In every case I can think of, I've wanted (0).numbits() to be 0. Here is surely the wrong place to respond to http://bugs.python.org/msg71384 but I want to make clear that I think that (0).numbits()==-1 is the natural solution. At least for all square-and-multiply-like algorithms needed in cryptography (modular exponentiation, point multiplication on elliptic curves, generation of lucas numbers, etc) this property of .numbits() would be needed. -- http://mail.python.org/mailman/listinfo/python-list