Skip to content

Commit bb97b92

Browse files
christoph-cullmannsvigerske
authored andcommitted
avoid overflow in gap computation
1 parent cf9b0d1 commit bb97b92

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/CbcModel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ void CbcModel::analyzeObjective()
453453
cost = objValue;
454454
else if (cost != objValue)
455455
cost = -COIN_DBL_MAX;
456-
int gap = static_cast<int>(upper[iColumn] - lower[iColumn]);
456+
int64_t gap = static_cast<int64_t>(upper[iColumn] - lower[iColumn]);
457457
if (gap > 1) {
458458
numberGeneralIntegerObj++;
459459
numberIntegerWeight += gap;

0 commit comments

Comments
 (0)