Results 1 to 9 of 9

Thread: Same program same data different result

  1. #1

    Thread Starter
    Member King Arthur's Avatar
    Join Date
    Dec 2006
    Location
    UK
    Posts
    36

    Same program same data different result

    Hi, I don't know if this is the right place for this post. No doubt it will be moved if it isn't....

    I recently wrote a program which involved a lot of number crunching (thousands of operations) - but NO random numbers...

    On an machine running XP I get one answer - on a machine running Vista I get a slightly different answer.

    Anyone any ideas? Is there a difference between Vista and XP in the way they deal with numbers?

    Thanks.

  2. #2
    PowerPoster
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,070

    Re: Same program same data different result

    You could start by showing some of your code? We can't guess what kind of operations you are talking about, can we?

  3. #3
    Fanatic Member Dnereb's Avatar
    Join Date
    Aug 2005
    Location
    Netherlands
    Posts
    863

    Re: Same program same data different result

    Do you use Doubles and .... is the Vista 64 bits?
    Would explain a lot.
    why can't programmers keep and 31 Oct and 25 dec apart. Why Rating is Useful
    for every question you ask provide an answer on another thread.

  4. #4

    Thread Starter
    Member King Arthur's Avatar
    Join Date
    Dec 2006
    Location
    UK
    Posts
    36

    Re: Same program same data different result

    There isn't anything fancy in the operations - just the four rules of number. There is far to much code to start quoting it... It is a big program....

    The Vista laptop is 32 bit. I don't use doubles in the part of the program that causes the small differences.

    I just wondered if there was anything obvious in the way Vista worked that could account for it...

  5. #5
    Fanatic Member VBAhack's Avatar
    Join Date
    Dec 2004
    Location
    Sector 000
    Posts
    617

    Re: Same program same data different result

    Perhaps a stupid question, but if you ran it 10 times on the same machine, do you get the exact same answer every time?

  6. #6
    Frenzied Member MaximilianMayrhofer's Avatar
    Join Date
    Aug 2007
    Location
    IM IN YR LOOP
    Posts
    2,001

    Re: Same program same data different result

    Without a doubt, the difference is caused by the way the two operating systems handle numbers. How, exactly, though i'm not sure.

  7. #7
    Fanatic Member Dnereb's Avatar
    Join Date
    Aug 2005
    Location
    Netherlands
    Posts
    863

    Re: Same program same data different result

    Still thinking it's about doubles or singles
    probably some inexplicit conversion to a double like

    Dim A as Long
    A = tolng(34 + (71/3) *( 5/6))

    Or
    Dim A as Variant
    A = 9872442/957
    why can't programmers keep and 31 Oct and 25 dec apart. Why Rating is Useful
    for every question you ask provide an answer on another thread.

  8. #8
    PowerPoster Code Doc's Avatar
    Join Date
    Mar 2007
    Location
    Omaha, Nebraska
    Posts
    2,354

    Re: Same program same data different result

    Quote Originally Posted by King Arthur
    There isn't anything fancy in the operations - just the four rules of number. There is far to much code to start quoting it... It is a big program....

    The Vista laptop is 32 bit. I don't use doubles in the part of the program that causes the small differences.

    I just wondered if there was anything obvious in the way Vista worked that could account for it...
    Vista has nothing to do with it. The computer hardware that uses the operating system might have something to do with it.
    Doctor Ed

  9. #9

    Thread Starter
    Member King Arthur's Avatar
    Join Date
    Dec 2006
    Location
    UK
    Posts
    36

    Smile Re: Same program same data different result

    Thanks a lot Code Doc. I wouldn't want to blame Vista if the problem might lie elsewhere.... anyway - it is something I can 'live with'.
    Regards
    King Arthur

Posting Permissions

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



Click Here to Expand Forum to Full Width