[PPL-devel] [GIT] ppl/ppl(floating_point): Added necessary static_cast when computing absolute error.

Fabio Bossi bossi at cs.unipr.it
Thu Sep 3 09:58:32 CEST 2009


Module: ppl/ppl
Branch: floating_point
Commit: 9e66883a1028866f4924f0adf6a14d4771d0f5e2
URL:    http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=9e66883a1028866f4924f0adf6a14d4771d0f5e2

Author: Fabio Bossi <bossi at cs.unipr.it>
Date:   Thu Sep  3 10:01:15 2009 +0200

Added necessary static_cast when computing absolute error.

---

 src/Floating_Point_Expression.defs.hh |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/Floating_Point_Expression.defs.hh b/src/Floating_Point_Expression.defs.hh
index 0858e94..1db239e 100644
--- a/src/Floating_Point_Expression.defs.hh
+++ b/src/Floating_Point_Expression.defs.hh
@@ -85,7 +85,9 @@ public:
 template <typename FP_Interval_Type, typename FP_Format>
 typename Floating_Point_Expression<FP_Interval_Type, FP_Format>::boundary_type
 Floating_Point_Expression<FP_Interval_Type, FP_Format>::absolute_error =
-  std::max(pow(2, 1 - FP_Format::exponent_bias - FP_Format::fraction_bits),
+  std::max(static_cast<typename Floating_Point_Expression<FP_Interval_Type,
+	   FP_Format>::boundary_type>
+           (pow(2, 1 - FP_Format::exponent_bias - FP_Format::fraction_bits)),
   std::numeric_limits<typename Floating_Point_Expression<FP_Interval_Type,
                                                          FP_Format>
 	                       ::boundary_type>::denorm_min());




More information about the PPL-devel mailing list