}
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;
}