Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.
Originally posted by: sandeepsinghchauhan
I have a vector
X = [1,3,5,8,9];
X is float datatype
My problem is i want to create ranges like
range one = 1..X[1];
range two = 1..X[2];
range three = 1..X[3];
.
Like that But its not working showing error "1 does not exist"
Originally posted by: Mintch Zulitch
Hi,
I think the X is defined over the float type; and you can't construct ranges based on float parameters. Ranges can only be defined over the integer domain. Therefore the X should be int type.
Hi
You could write:
float X[1..5] = [1,3,5.1,8,9.2]; range float one = 1..X[1]; range float two = 1..X[2]; range float three = 1..X[3]; execute { writeln(one.UB); writeln(two.UB); writeln(three.UB); }
float X[1..5] = [1,3,5.1,8,9.2];
range float one = 1..X[1];
range float two = 1..X[2];
range float three = 1..X[3];
execute { writeln(one.UB); writeln(two.UB); writeln(three.UB); }
which gives
1 3 5.1
regards