Browse Source

OR equation correction

Debashis Chandra Ray 6 years ago
parent
commit
569f50f5c4
1 changed files with 6 additions and 2 deletions
  1. 6 2
      JavaScript/JavaScript_SDK/CertainTrust.js

+ 6 - 2
JavaScript/JavaScript_SDK/CertainTrust.js

@@ -277,8 +277,12 @@ CertainTrust.prototype._singleOR = function(arg) {
 
 	resF = f1 + f2 - f1*f2;
 
-	if (this._almostEqual(resF, 0))
-		resC = c1 + c2 - c1*c2;
+	if (this._almostEqual(resF, 0)){
+		f1 = 0.99999;
+		f2 = 0.99999;
+		resF = f1 + f2 - f1*f2;
+		resC = c1 + c2 - c1*c2- (c1*f2*(1-c2)*(1-t1)+c2*f1*(1-c1)*(1-t2)) / resF;
+	}
 	else
 		resC = c1 + c2 - c1*c2 - (c1*f2*(1-c2)*(1-t1)+c2*f1*(1-c1)*(1-t2)) / resF;