IMPORTANT NOTICE: As of 21 February, anything posted in this community WILL NOT BE MIGRATED to our new community site. We have pulled all user information and data from this site and are now in an approximately week long process of importing users, roles, and data to our new site. We are leaving this site open and active so you can post and hopefully get a response until the migration is complete. Once complete, the URL that currently takes you to this site will take you to our new site so your bookmarks will work as always. Please read the information on a New Login Process
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