Help with Monte Carlo Project

Thanks!
Last edited on
It would help if you had consistent code formatting, it's tricky to read what you have.

srand() should be called once to seed the PRNG.

PI converges very slowly using Monte Carlo, so you need to run it a few million times, a thousand times won't do anything.

You know that in_count = in_count + 0; does nothing, right?

You should hardcode R = 1, then the check for in/out becomes trivial, otherwise you need a square root.
http://www.cplusplus.com/forum/unices/75447/#msg405443
Last edited on
Topic archived. No new replies allowed.