example code
Expand|Select|Wrap|Line Numbers
- double RandNum,pp;
- double axis=AXIS;
- double wise_profit=0.20;
- double mu, delta,a,b;
- double sattisfic_price;
- RandNum=Rand.getRandomFloat();
- if(prod_size<=prod_sold && prod_sold>0) SetPrice(GetPrice()+axis*RandNum);
- else if(prod_size>prod_sold && prod_sold>0)
- {
- mu=wise_profit*interestrate*satisfic_wage*numworkers;
- delta=prod_size*prod_size*(1-mu/(interestrate*satisfic_wage*numworkers));
- a=(-prod_size*prod_size)/(4*interestrate*satisfic_wage*numworkers);
- b=prod_size;
- sattisfic_price=(-b-sqrt(delta))/(2*a); <<-------- Here is the error
- SetPrice(sattisfic_price);
- }