
I think, a simple C question - HELP NEEDED
* Any body familier with Numerical Recipes in C .... it's page 283
Hello,
I am a VERY, VERY inexperienced beginning C person. (can't really
call myself a programmer)
I am tyring to use a routine in the Numerical Recipes in C book to
write a program that calculates definate integrals by the Monte Carlo
method.
Anyway my question is very simple...
The function in Num. Rec. in C is called ran3 and I CAN NOT for the life
of me extract a random number from the routine.....
If I have a routine that looks like this....
===============================================
float ran3(long *idum)
{........... return mj*FAC; }
How would I properly write a main() that calls the function and returns
the result that ran3 produces.
I think I'm having a hard time dealing with the 'long *idum'
The Num.Rec.in.C says "Set idum to any negative value to initialize or
reinitialize the sequence"
I don't know what to do.....
_____________________________
/ Mark Decker \ 2026 AD
| Physics, CREOL -UCF | inflection point)
| |
| www.creol.ucf.edu/~madecker | There is too much life
\_____________________________/ and not enough death.