Avoid overflow when handling complementarity constraints.