Originally posted by: SystemAdmin
Hi,
the code
int n = 10;
range s = 1..n;
int a[s] = [0,10,20,30,40,0,60,70,80,90];
{int} b = {w|w in s:a[w]^2 <= 10000};
{int} c = {w|w in s:a[w]*a[w] <= 10000};
execute
{
writeln("b=",b);
writeln("c=",c);
}
results in
b= {}
c= {1 2 3 4 5 6 7 8 9 10}
As far as I remember the operator '^2' does not correspond
to the expected 'squared' operator, but to some bit-operation
('exclusive or').
Regards
Norbert
#DecisionOptimization#OPLusingCPLEXOptimizer