hello..i dont know if the title suitable
i have this math formulation
HMeix (exp 0.05(rnd[min,max]))
HMei= val
this is part of my code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
case NONLINEAR1: //HMei x (exp ^ d(rand[min,max]))
double min, max;
double z, r, t;
double d = 0.05;
min = -val;
max = val;
z = random()%(max-min)+min; //randomval
r = d*z;
t = exp(double r);
return (long)(val*t); // val*exp of (delta*(randomval))
break;
default:
printf("Unknown modifier choice");
exit(0);
}
and i get this error;
Error 1: 'random' : function does not take 0 arguments
Error 2: syntax error : 'double' should be preceded by ')'
Error 3: 'exp' : no overloaded function takes 0 arguments
Error 4: syntax error : ')'
can someone explain why n help me with this..please
1) random requires a range as parameter
2) You declare a double r in the parameter section of a function. Compiler thinks you intend to type-cast
3) same as 2
4) same as 2