зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1527007 - Work around Windows fmod bugs r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D21407 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
3a13844ccd
Коммит
19ce0ac165
|
@ -36,7 +36,16 @@ inline double NumberMod(double a, double b) {
|
|||
if (b == 0) {
|
||||
return JS::GenericNaN();
|
||||
}
|
||||
return fmod(a, b);
|
||||
double r = fmod(a, b);
|
||||
#if defined(XP_WIN)
|
||||
// Some versions of Windows (Win 10 v1803, v1809) miscompute the sign of zero
|
||||
// results from fmod. The sign should match the sign of the LHS. This bug
|
||||
// only affects 64-bit builds. See bug 1527007.
|
||||
if (mozilla::IsPositiveZero(r) && mozilla::IsNegative(a)) {
|
||||
return -0.0;
|
||||
}
|
||||
#endif
|
||||
return r;
|
||||
}
|
||||
|
||||
} // namespace js
|
||||
|
|
Загрузка…
Ссылка в новой задаче