Click here to Skip to main content
15,943,078 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CALLBACK Pin
Gary R. Wheeler13-Mar-04 5:45
Gary R. Wheeler13-Mar-04 5:45 
GeneralRe: CALLBACK Pin
Shi Zhu13-Mar-04 15:07
Shi Zhu13-Mar-04 15:07 
GeneralCFormView MDI App. Pin
nimrodel12-Mar-04 17:41
nimrodel12-Mar-04 17:41 
GeneralRe: CFormView MDI App. Pin
Antti Keskinen13-Mar-04 23:05
Antti Keskinen13-Mar-04 23:05 
GeneralRe: CFormView MDI App. Pin
nimrodel14-Mar-04 21:39
nimrodel14-Mar-04 21:39 
Generalsquare-root project Pin
bishead12-Mar-04 17:12
bishead12-Mar-04 17:12 
GeneralRe: square-root project Pin
greba12-Mar-04 17:59
greba12-Mar-04 17:59 
GeneralRe: square-root project Pin
Roger Wright12-Mar-04 18:39
professionalRoger Wright12-Mar-04 18:39 
You define difference as the current estimate squared minus the original square input by the user. The closer you get, the smaller the difference should be until it is less than the value .00001. In your while statement you are expecting the square of your estimated root minus the difference to get smaller. It won't converge.

For a start, change

while (estimateSquareRoot*estimateSquareRoot-difference>=.00001);

to

while(difference >= .00001);

Also, before you evaluate the difference, replace it by its absolute value. A difference of -.000009 satisfies the algorithm, but will not pass the test in the while statement.



Will Build Nuclear Missile For Food - No Target Too Small
GeneralAbout MSChart Pin
junli12-Mar-04 15:49
junli12-Mar-04 15:49 
GeneralUsing File Streams with an MFC app Pin
Blue Pyre12-Mar-04 13:11
Blue Pyre12-Mar-04 13:11 
GeneralRe: Using File Streams with an MFC app Pin
Michael Dunn12-Mar-04 15:01
sitebuilderMichael Dunn12-Mar-04 15:01 
GeneralRe: Using File Streams with an MFC app Pin
l a u r e n12-Mar-04 20:25
l a u r e n12-Mar-04 20:25 
GeneralRe: Using File Streams with an MFC app Pin
Blue Pyre12-Mar-04 22:52
Blue Pyre12-Mar-04 22:52 
GeneralRe: Using File Streams with an MFC app Pin
Antti Keskinen13-Mar-04 23:09
Antti Keskinen13-Mar-04 23:09 
GeneralFTP and Ident Server :: Winsock Pin
valikac12-Mar-04 10:14
valikac12-Mar-04 10:14 
GeneralRe: FTP and Ident Server :: Winsock Pin
Rob Groves12-Mar-04 11:23
Rob Groves12-Mar-04 11:23 
GeneralRe: FTP and Ident Server :: Winsock Pin
valikac12-Mar-04 12:43
valikac12-Mar-04 12:43 
GeneralSend Print Job Pin
Anonymous12-Mar-04 9:22
Anonymous12-Mar-04 9:22 
GeneralRe: Send Print Job Pin
Rob Groves12-Mar-04 11:32
Rob Groves12-Mar-04 11:32 
Generaledit boxes linking Pin
Oriented12-Mar-04 9:05
Oriented12-Mar-04 9:05 
Generaledit boxes linking Pin
Oriented12-Mar-04 9:02
Oriented12-Mar-04 9:02 
GeneralRe: edit boxes linking Pin
David Crow12-Mar-04 9:29
David Crow12-Mar-04 9:29 
GeneralRe: edit boxes linking Pin
John R. Shaw12-Mar-04 11:56
John R. Shaw12-Mar-04 11:56 
GeneralRe: edit boxes linking Pin
Branislav13-Mar-04 0:27
Branislav13-Mar-04 0:27 
GeneralWin32 TimerQueue problems on DUAL PROCESSORS Pin
Gavin Stark12-Mar-04 8:47
Gavin Stark12-Mar-04 8:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.