Added a swap function to the expression parser.

This commit is contained in:
TomyLobo 2011-11-28 00:29:38 +01:00
parent 255e342353
commit a6f0a48f84

View File

@ -257,7 +257,16 @@ public final class Functions {
x.assign(xOld * cosF - yOld * sinF); x.assign(xOld * cosF - yOld * sinF);
y.assign(xOld * sinF + yOld * cosF); y.assign(xOld * sinF + yOld * cosF);
return 0; return 0.0;
}
public static final double swap(LValue x, LValue y) throws EvaluationException {
final double tmp = x.getValue();
x.assign(y.getValue());
y.assign(tmp);
return 0.0;
} }