Constrained random question

In reply to dave_59:

I think we need still little modification in the code.

constraint sum_xy { x.sum(Xi) with (int’(Xi*y[Xi.index])) < Val;}

One thing I don’t get it why do we need to cast it to “int”?