[PPL-devel] [GIT] ppl/ppl(floating_point): Use ROUND_DOWN instead of ROUND_UP to compute the negation of the upper

Fabio Bossi bossi at cs.unipr.it
Thu Sep 17 10:50:09 CEST 2009


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

Author: Fabio Bossi <bossi at cs.unipr.it>
Date:   Thu Sep 17 10:52:37 2009 +0200

Use ROUND_DOWN instead of ROUND_UP to compute the negation of the upper
bound of -var.

---

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

diff --git a/src/Octagonal_Shape.templates.hh b/src/Octagonal_Shape.templates.hh
index 1d93abf..0c6efd2 100644
--- a/src/Octagonal_Shape.templates.hh
+++ b/src/Octagonal_Shape.templates.hh
@@ -5339,7 +5339,7 @@ linear_form_upper_bound(const Linear_Form< Interval<T, Interval_Info> >& lf,
       assign_r(curr_var_ub, matrix[n_var+1][n_var], ROUND_NOT_NEEDED);
       div_2exp_assign_r(curr_var_ub, curr_var_ub, 1, ROUND_UP);
       neg_assign_r(curr_minus_var_ub, matrix[n_var][n_var+1], ROUND_NOT_NEEDED);
-      div_2exp_assign_r(curr_minus_var_ub, curr_minus_var_ub, 1, ROUND_UP);
+      div_2exp_assign_r(curr_minus_var_ub, curr_minus_var_ub, 1, ROUND_DOWN);
       // Optimize the most common case: curr = +/-[1;1]
       if (curr_lb == 1 && curr_ub == 1) {
         add_assign_r(result, result, std::max(curr_var_ub, curr_minus_var_ub),




More information about the PPL-devel mailing list