When using the division operator against two integers, SilkTest will always round down to the nearest int. See example below:- [-] testcase division2() appstate none [ ] REAL rResult [ ] rResult = 1 / 2 [ ] print(rResult) The above will provide the following result:- [-] Testcase division - Passed [ ] 0.000000 However, if you cast the integer values to REAL, the calculation will return the correct value. [-] testcase division() appstate none [ ] REAL rResult [ ] rResult = [REAL]1/[REAL]2 [ ] print(rResult) The above test will result in the following:- [-] Testcase division - Passed [ ] 0.500000
↧