Skip to content

Commit

Permalink
use floor and ceil to ensure int bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
Wout4 committed Feb 29, 2024
1 parent 8f7fc6e commit 82824ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cpmpy/transformations/flatten_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def get_or_make_var(expr):
(flatexpr, flatcons) = normalized_numexpr(expr)

lb, ub = flatexpr.get_bounds()
ivar = _IntVarImpl(lb, ub)
ivar = _IntVarImpl(math.floor(lb), math.ceil(ub))
return (ivar, [flatexpr == ivar]+flatcons)

def get_or_make_var_or_list(expr):
Expand Down

0 comments on commit 82824ad

Please sign in to comment.