Mark Dickinson <dicki...@gmail.com> added the comment:

About the name:

Java's Bignum has a 'significantBits' method, which apparently returns 
the position of the MSB (i.e., numbits - 1).

GMP has mpz_sizeinbase;  mpz_sizeinbase(n, 2) is almost the same as 
numbits, except that mpz_sizeinbase(0, 2) is 1, not 0.

Mathematica has BitLength.  I quite like this.

Googling for 'ilog2' returns a good few relevant hits; again, this is 
really numbits - 1, not numbits.

How about n.bitlength?

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue3439>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to