Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ > loop until two ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 43794 of 47926
Post > Topic >>

loop until two doubles differ by 0.00001

by yogi_bear_79 <yogi_bear_79@[EMAIL PROTECTED] > Mar 10, 2008 at 06:40 PM

I am working on divide-and-average lab.  I everything done excep the
syntax for the loop. The loop should run replaceing x with the resutls
of (x + a/x )/2 until x,  and (x + a/x )/2 differ by no more than a
given amout, for example 0.00001.  I've tried various ideas, the
closest I came was while(x - divavg(a, x)  != 0), which more or les
sworked. It stoppend the loop when x =  (x + a/x )/2, but I'm not sure
that exactly meets the goal.
 




 3 Posts in Topic:
loop until two doubles differ by 0.00001
yogi_bear_79 <yogi_bea  2008-03-10 18:40:08 
Re: loop until two doubles differ by 0.00001
hurcan solter <hsolter  2008-03-10 19:16:48 
Re: loop until two doubles differ by 0.00001
yogi_bear_79 <yogi_bea  2008-03-10 19:34:11 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Oct 6 18:13:07 CDT 2008.