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

> ... so that ``k`` is approximately ``1 + int(log(abs(x), 2))``.

I guess that could work.

One other thing:  the docs for the trunk seem to suggest that we should 
be using trunc here, rather than int.  I'm looking at:

http://docs.python.org/dev/library/stdtypes.html#numeric-types-int-
float-long-complex

and particularly the note (2), that says of int(x) and long(x):

"Deprecated since version 2.6: Instead, convert floats to long 
explicitly with trunc()."

_______________________________________
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