From 952e3afb90281f6cc8f8a21c103fd6eae2f3c195 Mon Sep 17 00:00:00 2001 From: "Christoph M. Wintersteiger" Date: Sun, 24 Apr 2016 15:11:24 +0100 Subject: [PATCH] bugfix for hwf_manager::rem --- src/util/hwf.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/util/hwf.cpp b/src/util/hwf.cpp index 8c184b8d2..a990e6e6d 100644 --- a/src/util/hwf.cpp +++ b/src/util/hwf.cpp @@ -383,17 +383,10 @@ 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) { - // The built-in fmod() works, except for the special numbers. + o.value = remainder(x.value, y.value); - if (is_inf(x) && is_inf(y)) - o.value = x.value/y.value; // NaN - else if (is_inf(y)) - o.value = x.value; - else - o.value = fmod(x.value, y.value); - - // Here is an x87 alternative if the above makes problems; this may also be faster. #if 0 + // Here is an x87 alternative if the above makes problems; this may also be faster. double xv = x.value; double yv = y.value; double & ov = o.value;