diff --git a/src/util/hwf.cpp b/src/util/hwf.cpp index a990e6e6d..8c10e3170 100644 --- a/src/util/hwf.cpp +++ b/src/util/hwf.cpp @@ -383,7 +383,13 @@ void hwf_manager::round_to_integral(mpf_rounding_mode rm, hwf const & x, hwf & o } void hwf_manager::rem(hwf const & x, hwf const & y, hwf & o) { +#if defined(_WINDOWS) && _MSC_VER < 1800 + o.value = fmod(x.value, y.value); + if (o.value >= (y.value/2)) + o.value /= 2.0; +#else o.value = remainder(x.value, y.value); +#endif #if 0 // Here is an x87 alternative if the above makes problems; this may also be faster.