Numerical Recipes Forum  

Go Back   Numerical Recipes Forum > Obsolete Editions Forum > General Hints, Tips, and Tricks for Using NR

Reply
 
Thread Tools Display Modes
  #1  
Old 01-14-2004, 03:33 AM
lima lima is offline
Member
 
Join Date: Jan 2004
Posts: 1
Question Floating point representations

Hi,
I was taking a look to the code of the function zbrent (Brent's method, Fortran 77 2nd ed.) and I saw this line of code:

if(abs(xm).le.tol1.or.fb.eq.0.) then

Shouldn't this type of expression be replaced to avoid strange results? Because of the comparison fb.eq.0.

Ricardo
Reply With Quote
  #2  
Old 01-14-2004, 09:29 AM
Saul Teukolsky Saul Teukolsky is offline
Numerical Recipes Author
 
Join Date: Dec 2001
Posts: 211
Hi Ricardo,

The method converges because of the first test. The test for fb.eq.0 is there only to take care of the special case when fb really is exactly zero.

Saul Teukolsky
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 06:56 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.