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.
This commit is contained in:
Tim Peters 2001-11-01 23:59:56 +00:00
parent 95837f1973
commit 4e8ab5db38
1 changed files with 1 additions and 1 deletions

View File

@ -476,7 +476,7 @@ float_divmod(PyObject *v, PyObject *w)
fmod returns different results across platforms; ensure
it has the same sign as the denominator; we'd like to do
"mod = wx * 0.0", but that may get optimized away */
mod = 0.0;
mod *= mod; /* hide "mod = +0" from optimizer */
if (wx < 0.0)
mod = -mod;
}