Originally posted by: anahana
Hi all,
I created a variable using IloNumVar and want to use it in a cos function. Something like this:
IloNumVar IloNumVar y1(env, -5.12, 5.12, "y1");
IloObjective obj = IloMinimize(env, (IloPower(y1,2) - 10*cos(2*IloPi*y1*IloPi/180) + 10));
However, when compiling the program I get this error message:
error C2665: 'cos' : none of the 3 overloads could convert all the argument types
I know the cos function expects a float or a long double as arguments, but can't I use IloNumVar with the cos function?
Regards,
#CPOptimizer#DecisionOptimization