Re: A pretty little bug in my code, need advice?

  • From: Alex Hall <mehgcap@xxxxxxxxx>
  • To: programmingblind@xxxxxxxxxxxxx
  • Date: Wed, 7 Jul 2010 11:43:13 -0400

Can you re-post the code as I did not see it the first time? It sounds
like what is happening is
8+8+8/3
so the 8/3 happens first, then is added to 16. Use of parentheses is
likely going to solve it, but I would need to see the code first.

On 7/7/10, Jes <theeternalkid@xxxxxxxxx> wrote:
> Although the syntax of the code appears to be fine, I'm experiencing a nice
> little bug where all of the variables are being added and the result divided
> up in the same pass. This causes the prog to generate off the wall numbers.
> For example, if you put the number 8 for all three values, when it divides
> by 3, it gives you something like 18.6.
> As far as I can tell, and somebody correct me if I'm wrong, What I need to
> do is to have the program press an enter after each value  is added. How do
> I implement this in my code?
> Thanks
> Jes
>
> __________
> View the list's information and change your settings at
> //www.freelists.org/list/programmingblind
>
>


-- 
Have a great day,
Alex (msg sent from GMail website)
mehgcap@xxxxxxxxx; http://www.facebook.com/mehgcap
__________
View the list's information and change your settings at 
//www.freelists.org/list/programmingblind

Other related posts: