Hi,
yes you may get decimal numbers by dividing integer variables.
See
float sqrt2=sqrt(2);
dvar float f;
dvar int i;
execute
{
writeln("square root of 2 = ",sqrt2);
}
minimize abs(f-sqrt2);
subject to
{
f==i/100;
}
execute
{
writeln("square root of 2 with 2 decimals only = ",f);
}
which gives
square root of 2 = 1.414213562
square root of 2 with 2 decimals only = 1.41
regards
#DecisionOptimization#OPLusingCPLEXOptimizer