Browse Source

Property, constants in RESULTs: support BigRationals

Support matching of constants in RESULT strings for the case
that constants in the model are exact rational
numbers (implemented in subsequent commits).
master
Joachim Klein 8 years ago
committed by Dave Parker
parent
commit
6f3b25d0b8
  1. 3
      prism/src/parser/ast/Property.java

3
prism/src/parser/ast/Property.java

@ -190,6 +190,9 @@ public class Property extends ASTElement
// Check doubles numerically
else if (constValToMatch instanceof Double)
match = PrismUtils.doublesAreCloseRel(((Double) constValToMatch).doubleValue(), Double.parseDouble(constVal), 1e-10);
// if constant is exact rational number, compare exactly
else if (constValToMatch instanceof BigRational)
match = BigRational.from(constVal).equals(constValToMatch);
// Otherwise just check for exact string match for now
else
match = constValToMatch.toString().equals(constVal);

Loading…
Cancel
Save