Skip to main content

Variable: IntVarMax

const IntVarMax: 1073741823 = 1073741823

Maximum value of a decision variable or a decision expression (such as x+1 where x is a variable).

Example

The following model is infeasible:

let model = new CP.Model();
let x = model.intVar({range: [10000000, 2000000]});
// Constraint x*x >= 1:
model.constraint(x.times(x).ge(1));
let result = await CP.solve(model);

Because for any value of x, the expression x*x is greater than IntVarMax and thus cannot be computed.