Mercurial > cpython-lru_cache-weakref
diff Modules/mathmodule.c @ 19716:fb2d83aaff68 legacy-trunk
loghelper(): Try to nudge the compiler into doing mults in an order that
minimizes roundoff error.
| author | Tim Peters <tim.peters@gmail.com> |
|---|---|
| date | Wed, 05 Sep 2001 04:33:11 +0000 |
| parents | 9433dd3c197e |
| children | 2e6da2dd2ab8 |
line wrap: on
line diff
--- a/Modules/mathmodule.c Wed Sep 05 02:27:04 2001 +0000 +++ b/Modules/mathmodule.c Wed Sep 05 04:33:11 2001 +0000 @@ -263,7 +263,7 @@ 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); }
