how can i make this mathematical formulation into coding

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
the value from min and max is based on HM value
for example if the HM value =1;
the value of min and max will be choose randomly between -1 and 1
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
Topic archived. No new replies allowed.