I am having difficulty with silktest getting a multiplication calculation wrong where there are three amounts going into the sum; the line of code is this:
The values of the reals are (in order) 37323.000000, 3.100000 and 1.400000.
According to any decent calculator, the result of this calculation is 82643.785714, while silktest is giving the value 82643.784579 (which, when rounded to 2dp, gives me the wrong answer (82643.78 instead of 82643.79).
Has anybody else had a problem of this kind? Have you found any workaround?
I am using NT 4.0 SP5, with SilkTest 5.0.1.
But this is getting strange; when I construct a simple example (such as your TestReal testcase styler), I get the correct answer too. But when the calculation needs to be done in the middle of my testcase, it consistently gets the wrong answer.
I shall carry on poking around to see if I can find an answer - there must be some crucial difference between these two cases.
I found the problem; it was in the two lines above the one I quote:
This function does a sql query (through the DBTester functions) on our aut's database, to find the relevant value. These function calls were apparently returning the values 1.400000 and 3.100000, but the actual values returned must have been slightly different, because the wrong answer was given to the calculation; if I replaced those two lines with the following:
then the correct answer was obtained.
It turns out further that the inaccuracy in these amounts was caused by the general inaccuracy silktest has with floating point values received back from sql queries, and so using the standard workaround (function to_char() or Str() in the sql query itself, then using Val() on the returned result) has fixed the problem.
But I remain deeply concerned that these values did differ slightly from 1.4 and 3.1, but when I had them printed to the results file, it did print "1.400000" and "3.100000"; it seems that silktest stores reals to a greater degree of precision than is revealed when these are converted to strings.