The following code runs once through the loop fine, but on the second pass, theEquation
has had its data changed even though nothing had referenced it.
String[] theEquation = breakdown(theequation);
double[] yValues = new double[400];
for(int i=0; i < bitmapx; i++){
Double v = xmin + (xstep * i);
yValues[i] = Double.parseDouble( solveArrayX( theEquation , v ) );
}
For example, the first time through the for loop, theEquation
will have { "x", "^", "2" }
. The next time will be { previousCalculatedAnswer, null, null }
Why is theEquation
being changed? No other code is referencing it.