next up previous
Next: Compiling and running Up: Lesson 4 -- Previous: The listing of

The synopsis of fifth.c

is computed by generating random points within a square, whose dimensions are 2 x 2, and checking how many of these points end up within a circle of radius 1. The ratio of that number to the total number of points generated by the random number server should be close to for a sufficiently large number of points.

The program begins by asking the user for required accuracy. The computation of will go on until either the required accuracy is reached, or until the number of points generated by the random number server exceeds certain hardwired limit.

The process responsible for writing to the VDU updates the displayed value of every time the results are collected from the workers.



Zdzislaw Meglicki
Tue Feb 28 15:07:51 EST 1995