STINNER Victor <victor.stin...@haypocalc.com> added the comment:

> Can't we simply use (approximation to 1/log(2)) * log(x)?
> Is it worse than reimplementing it using log(x)/log(2) in Python?

Hum. With a x86 and the right compiler optimization level, log(x)/log(2) in C 
can be more accurate than log(x)/log(2) in Python, because the FPU works with 
80 bits float internally, and the result is only "truncated" to 64 bits float 
at the end. In Python, the result is truncated to 64 bits on each Python 
instruction.

I don't know if it should be called a feature or a bug. In PHP world, it would 
be called a bug :-D http://bugs.php.net/bug.php?id=53632

----------

_______________________________________
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