>= Does Not Works Right


dle

Recommended Posts

With the script below:

 

Private Tolerance = 11

If ((CurrentVal <= (1000+Tolerance)) && (CurrentVal >= (1000-Tolerance))) 

      Test_Result = "PASS"

 Else

      Test_Result = "FAIL"

Endif

 

 

I don't know why in the case CurrentVal = 989, I have the Test_Result = FAIL  

Link to comment
Share on other sites

More than likely, currentVal is not actually 989, but instead 988.999999999, but is being displayed as 989.  I ran a test and the script you have worked fine:

 

private currentVal = 989
Private Tolerance = 11
private string test_result = ""
If ((CurrentVal <= (1000+Tolerance)) && (CurrentVal >= (1000-Tolerance))) 
      Test_Result = "PASS"
 Else
      Test_Result = "FAIL"
Endif
? test_result
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.