summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2001-11-01 23:59:56 (GMT)
committerTim Peters <tim.peters@gmail.com>2001-11-01 23:59:56 (GMT)
commit4e8ab5db38c84e981f1e4cd11fd375bf7469341e (patch)
treee95e713047782bf943bbeb24282c499026d2d181
parent95837f1973c0343f33bab0cc0fc98c32856d53e1 (diff)
downloadcpython-4e8ab5db38c84e981f1e4cd11fd375bf7469341e.zip
cpython-4e8ab5db38c84e981f1e4cd11fd375bf7469341e.tar.gz
cpython-4e8ab5db38c84e981f1e4cd11fd375bf7469341e.tar.bz2
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.
-rw-r--r--Objects/floatobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/floatobject.c b/Objects/floatobject.c
index 7e12a09..cdc9620 100644
--- a/Objects/floatobject.c
+++ b/Objects/floatobject.c
@@ -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;
}