[issue11888] Add C99's log2() function to the math library

STINNER Victor report at bugs.python.org
Mon May 2 01:27:46 CEST 2011


STINNER Victor <victor.stinner at haypocalc.com> added the comment:

Oh... math.log() has an optional second argument: base. math.log(x, 2). But it is equivalent as math.log(x) / math.log(2) in Python. math.log(x, 2) is implemented as:
  num=math.log(x)
  den=math.log(2)
  return num / den
where num and den are Python floats (64 bits).

So we don't benefit from 80 bits float used internally in x87.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11888>
_______________________________________


More information about the Python-bugs-list mailing list