realbasic-nug
[Top] [All Lists]

Re: RB2005 Windows Math

To: realbasic-nug at lists dot realsoftware dot com
Subject: Re: RB2005 Windows Math
From: GAmoore at aol dot com
Date: Tue, 29 Nov 2005 17:09:53 EST
Delivered-to: realbasic-nug at lists dot realsoftware dot com
I think this may be of interest to many people here. Evidently there is some 
bug in RB2005 
when compiled to Windows (from the Mac version) which produces incorrect 
arithmetic values. 
I have spent hours on this and there is no   rhyme or reason to it. The same 
code works fine on Mac 
(both IDE and compiled) and I   am told it works in the Windows IDE but not 
when compiled.
//////////////////////////////////////////////////
   dim i, a, b, c, x, y as integer
   dim s as String
   
   
   s = "x and y should be the same : 13, 29, ..." + EndOfLine
   for i = 0 to 10
     a = 13 + (i*7) + (i*17) + (i*41) + (i mod 3) + (i mod 11) + (i mod 19)
     x = a mod 52
     // x is the basic computation... what follows is an effort to get around 
using the mod function
     // but it too fails
     b =a \ 52
     c = 52*b
     y = a - c
     s = s + "x = " + str(x) + "   y = " + str(y) 
     s = s + " and a,b,c = " + str(a) + ", " + str(b) + ", " + str(c) + 
EndOfLine
   next
   MsgBox s
------------------------------------------------------------------------------
-----------
Both x and y are wrong. x is uniformily 0, while takes on negative and 
increasing large positive values.
And a, b, and c are all wrong too. 


Joe Strout wrote :
>But since we're on the topic, let me
>point out that you're doing a lot of stuff there.  It would be
>helpful to break the computation down into steps and see which one is
>going wrong, instead of only looking at the result of a long string
>of computations.

I have done that."a" above is fine. Its when the MOD function is invoked that 
the value of C changes to 0.

>please move it to the NUG, or simply file a feedback report.

I have not had good luck with the feedback/bug reporting at Real. I have 
filed probably half a dozen
bug reports - and never gotten any feedback one way or the other (with one 
exception when I 
complained on the list about this very issue), and never got any bugs fixed. 
The main reason I upgraded
to RB2005 was because the global variable bug in the debugger with Tiger was 
never fixed. 
In general, the debug system is a big pain to use, because there are 
different ways of describing the same
problem, or maybe its not the same problem?, and the searching, the lack of 
action and feedback.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>