![]() |
|
#1
|
|||
|
|||
|
Bug in mnbrak.cpp
The line
shft3(bx,cx,u,cx+GOLD*(cx-bx)); should be shft3(bx,cx,u,u+GOLD*(u-cx)); |
|
#2
|
|||
|
|||
|
Does this bug exist in the C version as well?
Should this line: Code:
SHFT(*bx,*cx,u,*cx+GOLD*(*cx-*bx)) Code:
SHFT(*bx,*cx,u,u+GOLD*(u-*cx)) Simon |
|
#3
|
|||
|
|||
|
Hi Simon,
No, the C code is correct. The reason is that a macro works differently from a function call. In a macro, the current values of variables are used at each stage. In a function call, the arguments are each evaluated independently. Regards, Saul Teukolsky |
|
#4
|
|||
|
|||
|
Ok, thanks very much.
Simon |
|
#5
|
|||
|
|||
|
MNbrak and brent in pascal, ver 1.3
I was wondering whether the bug somehow also applies to mnbrak for pascal, verison 1.3?
Last edited by grzes; 07-13-2004 at 06:20 AM. |
|
#6
|
|||
|
|||
|
No, only in the C++ v 2.10.
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|