Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Misc/ACKS
Original file line number Diff line number Diff line change
Expand Up @@ -1921,6 +1921,7 @@ Tim Tisdall
Jason Tishler
Christian Tismer
Jim Tittsler
Abhishek Tiwari
Frank J. Tobin
James Tocknell
Bennett Todd
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
The logarithm functions (such as :func:`math.log10` and :func:`math.log`) may now produce
slightly different results for extremely large integers that cannot be
converted to floats without overflow. These results are generally more
accurate, with reduced worst-case error and a tighter overall error
distribution.
2 changes: 1 addition & 1 deletion Modules/mathmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -2309,7 +2309,7 @@ loghelper(PyObject* arg, double (*func)(double))
assert(e >= 0);
assert(!PyErr_Occurred());
/* Value is ~= x * 2**e, so the log ~= log(x) + log(2) * e. */
result = func(x) + func(2.0) * e;
result = fma(func(2.0), (double)e, func(x));
}
else
/* Successfully converted x to a double. */
Expand Down
Loading