- Fixed bug with hashing which was not dependent on symbol and would thus give same hash for the range expressions applied to a different variable
- Fixed bug with hashing in which a < could weirdly show up due to unhandled - sign in original string hash
git-svn-id: https://openrocket.svn.sourceforge.net/svnroot/openrocket/trunk@1023
180e2498-e6e9-4542-8430-
84ac67f01cd8
}
public Double evaluateDouble(SimulationStatus status){
- return evaluate(status).getDoubleValue();
+ double result = evaluate(status).getDoubleValue();
+ if (result == Double.NEGATIVE_INFINITY || result == Double.POSITIVE_INFINITY) result = Double.NaN;
+ return result;
}
/*
* Used for temporary substitution when evaluating index and range expressions.
*/
public String hash(){
- Integer hashint = new Integer(this.getExpressionString().hashCode());
+ Integer hashint = new Integer(this.getExpressionString().hashCode() + symbol.hashCode());
String hash = "$";
for (char c : hashint.toString().toCharArray()){
+ if (c == '-') c = '0';
char newc = (char) (c + 17);
hash = hash + newc;
}