if(nHeight >= 1000) {
if((nHeight >= 101 && dDiff > 75) || nHeight >= 1000) { ///wouldn't this always evaluate to true because of the line above it?
// 222000/(((x+2600)/9)^2)
nSubsidy = (222000.0 / (pow((dDiff+2600.0)/9.0,2.0)));
if (nSubsidy > 25) nSubsidy = 25;
if (nSubsidy < 5) nSubsidy = 5;
} else {
nSubsidy = (1112.0 / (pow((dDiff+51.0)/6.0,2.0)));
if (nSubsidy > 500) nSubsidy = 50;
if (nSubsidy < 25) nSubsidy = 5;
}
} else {
nSubsidy = (1111.0 / (pow((dDiff+1.0),2.0)));
if (nSubsidy > 500) nSubsidy = 50;
if (nSubsidy < 1) nSubsidy = 1;
}
Any feedback, suggestions are welcome