Mercurial > cpython-lru_cache-weakref
diff Objects/floatobject.c @ 20829:14dc693af532 legacy-trunk
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.
| author | Tim Peters <tim.peters@gmail.com> |
|---|---|
| date | Thu, 01 Nov 2001 23:59:56 +0000 |
| parents | 95201153251c |
| children | 8cef75cacb01 |
line wrap: on
line diff
--- a/Objects/floatobject.c Thu Nov 01 23:17:35 2001 +0000 +++ b/Objects/floatobject.c Thu Nov 01 23:59:56 2001 +0000 @@ -476,7 +476,7 @@ 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; }
