lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master bdd39b7 08/10: Fix defect introduced 20050526


From: Greg Chicares
Subject: [lmi-commits] [lmi] master bdd39b7 08/10: Fix defect introduced 20050526T1235Z: precision loss
Date: Tue, 20 Dec 2016 01:31:04 +0000 (UTC)

branch: master
commit bdd39b7f9cbf03f3c93c397556ec972e9d895968
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Fix defect introduced 20050526T1235Z: precision loss
    
    detail::round_trunc() being templated on a floating-point type, it was
    incorrect to use an explicitly double-precision intermediate variable.
---
 round_to.hpp |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/round_to.hpp b/round_to.hpp
index c4f6f20..fd52d19 100644
--- a/round_to.hpp
+++ b/round_to.hpp
@@ -187,7 +187,7 @@ RealType round_trunc(RealType r)
         }
     return i_part;
 #else  // !defined LMI_HAVE_RINT
-    double x = std::floor(std::fabs(r));
+    RealType x = std::floor(std::fabs(r));
     return (0.0 <= r) ? x : -x;
 #endif // !defined LMI_HAVE_RINT
 }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]