[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
}
- [lmi-commits] [lmi] master updated (ae22927 -> 83d8eb3), Greg Chicares, 2016/12/19
- [lmi-commits] [lmi] master 6cfeca5 02/10: Drop support for an ancient non-free compiler, Greg Chicares, 2016/12/19
- [lmi-commits] [lmi] master dc47d4a 04/10: Improve documentation, Greg Chicares, 2016/12/19
- [lmi-commits] [lmi] master fa18f82 01/10: Remove references to nonexistent html documentation, Greg Chicares, 2016/12/19
- [lmi-commits] [lmi] master bdd39b7 08/10: Fix defect introduced 20050526T1235Z: precision loss,
Greg Chicares <=
- [lmi-commits] [lmi] master 83d8eb3 10/10: Experimentally rely on optimization of pow(long double, int), Greg Chicares, 2016/12/19
- [lmi-commits] [lmi] master eff3c7f 09/10: Rename a member datum for concinnity, Greg Chicares, 2016/12/19
- [lmi-commits] [lmi] master 0f3563c 05/10: Simplify conditionals using certain object-like macros, Greg Chicares, 2016/12/19
- [lmi-commits] [lmi] master 46d02c5 03/10: Expunge inline replacements for std::fabs() and std::floor() [425], Greg Chicares, 2016/12/19
- [lmi-commits] [lmi] master 54d2503 06/10: Presume std::rint() is available [424], Greg Chicares, 2016/12/19
- [lmi-commits] [lmi] master 84ed793 07/10: Simplify preprocessor conditionals, Greg Chicares, 2016/12/19