mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
loghelper(): Try to nudge the compiler into doing mults in an order that
minimizes roundoff error.
This commit is contained in:
parent
6fd0f0ac1e
commit
e5ca6c71cd
1 changed files with 1 additions and 1 deletions
|
@ -263,7 +263,7 @@ loghelper(PyObject* args, double (*func)(double), char *name)
|
|||
log(x) + log(2) * e * SHIFT.
|
||||
CAUTION: e*SHIFT may overflow using int arithmetic,
|
||||
so force use of double. */
|
||||
x = func(x) + func(2.0) * (double)e * (double)SHIFT;
|
||||
x = func(x) + (e * (double)SHIFT) * func(2.0);
|
||||
return PyFloat_FromDouble(x);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue