Forum Discussion

andy_cheetham's avatar
andy_cheetham
Occasional Contributor
13 years ago

Setting a tollerance when comparing 2 double values

Hi,



Is it possible to set some type of tollerance when comparing two doubles?



If not what is the recommened way of comparing a calulated value with a predefined valued. 



I am trying to compare values like 16.9986515029814 to 16.999



Any suggestions?



Cheers

Andy

3 Replies

  • andy_cheetham's avatar
    andy_cheetham
    Occasional Contributor
    I couldn't figure out a way to acheive this so I have gone an updated the check point but I am still getting the following error




    The "wValue("Width")" property of the "" object does not meet the checkpoint's condition.
































    Object name:

     

    Property:

    wValue("Width")

    Actual value

    12.4997783411529

    Expected value

    12.4997783411529

    Condition

    cmpEqual

    Case-sensitive

    true



    Can Somebody please explain what I am doing wrong.



    Cheers

    Andy

  • Hi Andy,


     


    Based on the error text, TestComplete cannot find the object where you call the wValue property. Could you please zip your entire project suite folder along with the log of the failed test execution and send the archive via the Contact Support form?