Kaydet (Commit) 4e8ab5db authored tarafından Tim Peters's avatar Tim Peters

float_divmod(): the code wasn't sick enough to stop the MS optimizer

from optimizing away mod's sign adjustment when mod == 0; so it got
the intended result only in the debug build.
üst 95837f19
...@@ -476,7 +476,7 @@ float_divmod(PyObject *v, PyObject *w) ...@@ -476,7 +476,7 @@ float_divmod(PyObject *v, PyObject *w)
fmod returns different results across platforms; ensure fmod returns different results across platforms; ensure
it has the same sign as the denominator; we'd like to do it has the same sign as the denominator; we'd like to do
"mod = wx * 0.0", but that may get optimized away */ "mod = wx * 0.0", but that may get optimized away */
mod = 0.0; mod *= mod; /* hide "mod = +0" from optimizer */
if (wx < 0.0) if (wx < 0.0)
mod = -mod; mod = -mod;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment