Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C > Re: Parallel pr...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 18 of 27 Topic 26196 of 26977
Post > Topic >>

Re: Parallel program to calculate PI

by Richard Heathfield <rjh@[EMAIL PROTECTED] > May 13, 2008 at 05:06 PM

Bart said:

> On May 13, 5:00 pm, Richard Heathfield <r...@[EMAIL PROTECTED]
> wrote:

<snip>

>> n %= max

* max;

>> ;
>> return;
>>
>> }
>>
>> If you call this i * max times, where max is a constant and i is an
>> integer, the distribution of the random points will be uniform.
> 
> You mean max*max?

Yes.

> This looks to be simply filling in a square sequentially.

Yes.

> You are then
> effectively calculating the area of a circle in a square by counting
> the all dots.

Yes.

> That's not really in the spirit of the original method.

No - but at least it would have been funny, if only I hadn't screwed it
up.

I once saw a wonderful pi calculation method on the Web (to which I can't 
find a URL right now) - it was a Monte Carlo method, which used millions 
of digits of pi as a PRNG, and concluded... that pi is about 3. Fabulous!

-- 
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www.
+rjh@[EMAIL PROTECTED]
 users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
 




 27 Posts in Topic:
Parallel program to calculate PI
Prime Mover <epleite@[  2008-05-13 07:20:09 
Re: Parallel program to calculate PI
Prime Mover <epleite@[  2008-05-13 07:28:37 
Re: Parallel program to calculate PI
Spiros Bousbouras <spi  2008-05-13 07:55:13 
Re: Parallel program to calculate PI
Spiros Bousbouras <spi  2008-05-13 07:57:53 
Re: Parallel program to calculate PI
Pietro Cerutti <gahr@[  2008-05-13 17:02:08 
Re: Parallel program to calculate PI
Richard Heathfield <rj  2008-05-13 15:28:47 
Re: Parallel program to calculate PI
CBFalconer <cbfalconer  2008-05-13 11:27:51 
Re: Parallel program to calculate PI
Bart <bc@[EMAIL PROTEC  2008-05-13 08:15:17 
Re: Parallel program to calculate PI
Spiros Bousbouras <spi  2008-05-13 08:31:25 
Re: Parallel program to calculate PI
Spiros Bousbouras <spi  2008-05-13 08:32:27 
Re: Parallel program to calculate PI
Richard Heathfield <rj  2008-05-13 16:00:59 
Re: Parallel program to calculate PI
Spiros Bousbouras <spi  2008-05-13 09:07:57 
Re: Parallel program to calculate PI
Richard Heathfield <rj  2008-05-13 16:38:59 
Re: Parallel program to calculate PI
Eric Sosman <Eric.Sosm  2008-05-13 12:43:51 
Re: Parallel program to calculate PI
Richard Heathfield <rj  2008-05-13 16:55:29 
Re: Parallel program to calculate PI
dj3vande@[EMAIL PROTECTED  2008-05-13 16:43:20 
Re: Parallel program to calculate PI
Bart <bc@[EMAIL PROTEC  2008-05-13 09:48:57 
Re: Parallel program to calculate PI
Richard Heathfield <rj  2008-05-13 17:06:03 
Re: Parallel program to calculate PI
CBFalconer <cbfalconer  2008-05-13 16:33:26 
Re: Parallel program to calculate PI
user923005 <dcorbit@[E  2008-05-13 12:08:38 
Re: Parallel program to calculate PI
Richard Heathfield <rj  2008-05-13 21:57:34 
Re: Parallel program to calculate PI
Prime Mover <epleite@[  2008-05-13 12:30:27 
Re: Parallel program to calculate PI
Keith Thompson <kst-u@  2008-05-13 13:02:02 
Re: Parallel program to calculate PI
Prime Mover <epleite@[  2008-05-13 13:00:38 
Re: Parallel program to calculate PI
Eric Sosman <Eric.Sosm  2008-05-13 16:19:35 
Re: Parallel program to calculate PI
user923005 <dcorbit@[E  2008-05-13 17:43:53 
Re: Parallel program to calculate PI
"dSpam@[EMAIL PROTEC  2008-05-15 02:42:48 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Jul 26 3:55:42 CDT 2008.