[PPL-devel] [GIT] ppl/ppl(floating_point): For consistency, use std::numeric_limits<T>: :is_exact in order to check

Fabio Bossi bossi at cs.unipr.it
Tue Sep 15 16:59:30 CEST 2009


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

Author: Fabio Bossi <bossi at cs.unipr.it>
Date:   Tue Sep 15 17:00:40 2009 +0200

For consistency, use std::numeric_limits<T>::is_exact in order to check
if T is a floating point type.

---

 src/Octagonal_Shape.templates.hh |   28 ++++++++--------------------
 1 files changed, 8 insertions(+), 20 deletions(-)

diff --git a/src/Octagonal_Shape.templates.hh b/src/Octagonal_Shape.templates.hh
index ce65f96..46cf817 100644
--- a/src/Octagonal_Shape.templates.hh
+++ b/src/Octagonal_Shape.templates.hh
@@ -483,12 +483,9 @@ void
 Octagonal_Shape<T>::refine_with_linear_form_inequality(
 		    const Linear_Form< Interval<T, Interval_Info> >& left,
 		    const Linear_Form< Interval<T, Interval_Info> >& right) {
-  /*
-    FIXME: this way for checking that T is a floating point type is a bit
-    unelengant.
-  */
+
   // Check that T is a floating point type.
-  PPL_ASSERT(std::numeric_limits<T>::max_exponent);
+  PPL_ASSERT(!std::numeric_limits<T>::is_exact);
 
   // FIXME: what to do when empty?
 
@@ -4870,12 +4867,9 @@ template <typename Interval_Info>
 void
 Octagonal_Shape<T>::affine_image(Variable var,
                     const Linear_Form< Interval<T, Interval_Info> >& lf) {
-  /*
-    FIXME: this way for checking that T is a floating point type is a bit
-    unelengant.
-  */
+
   // Check that T is a floating point type.
-  PPL_ASSERT(std::numeric_limits<T>::max_exponent);
+  PPL_ASSERT(!std::numeric_limits<T>::is_exact);
 
   // Dimension-compatibility checks.
   // The dimension of `lf' should not be greater than the dimension
@@ -5128,12 +5122,9 @@ void
 Octagonal_Shape<T>::
 linear_form_upper_bound(const Linear_Form< Interval<T, Interval_Info> >& lf,
                         N& result) const {
-  /*
-    FIXME: this way for checking that T is a floating point type is a bit
-    unelengant.
-  */
+
   // Check that T is a floating point type.
-  PPL_ASSERT(std::numeric_limits<T>::max_exponent);
+  PPL_ASSERT(!std::numeric_limits<T>::is_exact);
 
   const dimension_type lf_space_dimension = lf.space_dimension();
   PPL_ASSERT(lf_space_dimension <= space_dim);
@@ -5214,12 +5205,9 @@ Octagonal_Shape<T>::
 interval_coefficient_upper_bound(const N& var_ub, const N& minus_var_ub,
                                  const N& int_ub, const N& int_lb,
                                  N& result) {
-  /*
-    FIXME: this way for checking that T is a floating point type is a bit
-    unelengant.
-  */
+
   // Check that T is a floating point type.
-  PPL_ASSERT(std::numeric_limits<T>::max_exponent);
+  PPL_ASSERT(!std::numeric_limits<T>::is_exact);
 
   // NOTE: we store the first comparison term directly into result.
   PPL_DIRTY_TEMP(N, second_comparison_term);




More information about the PPL-devel mailing list