[PPL-devel] [GIT] ppl/ppl(floating_point): Corrected absolute error calculation to account for underflows.

Fabio Bossi bossi at cs.unipr.it
Wed Sep 2 11:29:28 CEST 2009


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

Author: Fabio Bossi <bossi at cs.unipr.it>
Date:   Wed Sep  2 11:23:28 2009 +0200

Corrected absolute error calculation to account for underflows.

---

 src/Floating_Point_Expression.defs.hh |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/Floating_Point_Expression.defs.hh b/src/Floating_Point_Expression.defs.hh
index f84c6a4..0d4e854 100644
--- a/src/Floating_Point_Expression.defs.hh
+++ b/src/Floating_Point_Expression.defs.hh
@@ -78,11 +78,14 @@ public:
 
 }; // class Floating_Point_Expression
 
-// Initialize static members of the class
+// Initialize static members of the class.
 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 =
-  pow(2, 1 - FP_Format::exponent_bias - FP_Format::fraction_bits);
+  std::max(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());
 
 } // namespace Parma_Polyhedra_Library
 




More information about the PPL-devel mailing list