Quantcast
Channel:
Viewing all articles
Browse latest Browse all 43869

Wiki Page: When dividing 2 integers, SilkTest will round down.

$
0
0
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

Viewing all articles
Browse latest Browse all 43869

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>