STINNER Victor <victor.stin...@haypocalc.com> added the comment: > we should check that it's not pow that's at fault here
Some tests on Mac OS X Tiger: >>> (2.0 ** -255).hex() '0x1.0000000000000p-255' => pow is correct >>> import ctypes; import ctypes.util, math >>> libc = ctypes.cdll.LoadLibrary(ctypes.util.find_library('c')) >>> clog2=libc.log2 >>> clog2.restype=ctypes.c_double >>> clog2.argtypes=(ctypes.c_double,) >>> clog2(2.0**-255) -254.99999999999997 >>> math.log(2.0**-255) / math.log(2.0) -255.0 >>> math.log(2.0**-255) -176.75253104278605 >>> math.log(2.0**-255).hex() '-0x1.61814bbfb3fb5p+7' >>> math.log(2.0) 0.6931471805599453 >>> math.log(2.0).hex() '0x1.62e42fefa39efp-1' >>> clog2(2.0**-255).hex() '-0x1.fdfffffffffffp+7' >>> (math.log(2.0**-255) / math.log(2.0)).hex() '-0x1.fe00000000000p+7' clog2() is wrong for 2^-255. ---------- _______________________________________ 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