|
-
January 21st, 2013, 05:58 PM
#8
Re: Square Roots and Totals Table c++
 Originally Posted by Rich1e1990
This is the way it should be?... I was also wondering what way I would go about adding a total row along the bottom?
Go back and change your loop to use integers, not doubles.
The reason is that floating point arithmetic is not exact. Right now, you're only getting away with it because you're adding 1 to the value. If you were adding 0.1 or some other fractional element, the loop will execute an indefinite number of times due to floating point rounding errors.
Regards,
Paul McKenzie
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|