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

See also issue 3724.

I'm -0 on this:  between log(x, 2) and int.bit_length, there's not much need 
for log2.  log(x, 2) should be plenty accurate enough for most numerical needs; 
 the exception is when you're taking log base 2 of an integer and need a 
guarantee of exact results for powers of 2, and int.bit_length generally solves 
that problem.

The main issue is that we'd have to provide (and maintain) our own 
implementation of log2 for Windows (and other OSs that don't have all the C99 
support.  Solaris?)  That implementation should, ideally:

 - provide exact values for powers of 2, and
 - be monotonic.

and that's not trivial.  As Raymond points out, on x86 / x64 we might be able 
to use inline assembly directly;  that would probably cover us for Windows.

----------

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

Reply via email to