SPONSORS:






User Tag List

Results 1 to 5 of 5
  1. #1
    Senior Member
    Join Date
    Aug 1999
    Location
    Cambridge, UK
    Posts
    470
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Inaccuracy when multiplying Reals?

    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?

  2. #2
    Senior Member
    Join Date
    Aug 1999
    Location
    MA
    Posts
    129
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Inaccuracy when multiplying Reals?

    Could not reproduce the issue on WinNT 4.0 SP6 with SilkTest 5.0.2:

    Got this:
    82643.785714

    What operating system / SilkTest version are you using?
    Steven Tyler
    Manager - Performance Engineering

    Kronos Incorporated
    tel: +1 978 947 4219

  3. #3
    Senior Member
    Join Date
    Jul 1999
    Location
    Burlingame CA 94010
    Posts
    502
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Inaccuracy when multiplying Reals?

    I got the same result - 82643.785714 on Windows98 2nd edition, SilkTest 5.03i



    ------------------
    John W Green
    jwgreen@automationexpertise.com
    http://www.automationexpertise.com

  4. #4
    Senior Member
    Join Date
    Aug 1999
    Location
    Cambridge, UK
    Posts
    470
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Inaccuracy when multiplying Reals?

    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.

  5. #5
    Senior Member
    Join Date
    Aug 1999
    Location
    Cambridge, UK
    Posts
    470
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Inaccuracy when multiplying Reals?

    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.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 04:15 AM.

Copyright BetaSoft Inc.