Now does ApproxEqualsTo instead of == when comparing doubles

Jonathan Bell [2012-04-11 19:48:46]
Now does ApproxEqualsTo instead of == when comparing doubles
Filename
columbus2/src/edu/columbia/cs/psl/metamorphic/compiler/MetamorphicPropertyCompiler.java
diff --git a/columbus2/src/edu/columbia/cs/psl/metamorphic/compiler/MetamorphicPropertyCompiler.java b/columbus2/src/edu/columbia/cs/psl/metamorphic/compiler/MetamorphicPropertyCompiler.java
index 081c645..0663ca4 100644
--- a/columbus2/src/edu/columbia/cs/psl/metamorphic/compiler/MetamorphicPropertyCompiler.java
+++ b/columbus2/src/edu/columbia/cs/psl/metamorphic/compiler/MetamorphicPropertyCompiler.java
@@ -186,7 +186,10 @@ public class MetamorphicPropertyCompiler {
 		if (rule.checkMethod().equals("==") || rule.checkMethod().equals(">=") || rule.checkMethod().equals("<=") || rule.checkMethod().equals("<")
 				|| rule.checkMethod().equals(">") || rule.checkMethod().equals("!=")) {
 			if (returnType.getKind().isPrimitive())
-				right = "metamorphic " + rule.checkMethod() + " " + right + ";";
+				if(returnType.getKind() == TypeKind.DOUBLE && rule.checkMethod().equals("=="))
+					right = "edu.columbia.cs.psl.metamorphic.outputRelation.impl.ApproximatelyEqualTo.applies(metamorphic,"+ right + ",0.000001);";
+				else
+					right = "metamorphic " + rule.checkMethod() + " " + right + ";";
 			else if(returnType.getKind() == TypeKind.ARRAY)
 			{
 				if (rule.checkMethod().equals("!="))