open source project hosted by : Donate Gridcoins to implement Gridcoin reward in GPU Address: SEtxQ4SePHSP 2xSfjy4MATvC WGoFMCcahn Intro & News Download (stable 10/2012) Results Movies... Huygen's Landing Status Extensions generator Search Engine Recommended readings OS People:deep space computing AGVisual Synapse Delphi Packager Lazarus Free Pascal Calculating Pi Database Version Control Hubble in a bottle! DelphiGL Mutella Khan Academy Others:Chalet Poschiavohacker.org Terragen Tutorial Picas Small world |
A way for computing PiDescription of the plugin greekpi.dllGreekpi is a plugin which computes Pi with the Monte Carlo method. Although not very useful in real life (206 billion of digits of Pi are known), it is a good academic example. The idea is to generate two random numbers between 0 and 1, which are considered as coordinates in the plane. Let’s call these two coordinates x and y. Now the plugin checks if the point (x,y) lies within a circle of radius 1. To do this square x and y, sum them together and check if the result is less than one. If the point (x,y) lies in the circle, increment the counter Sum by one. function pi(var stk : TStack):Boolean;stdcall; var Idx : Integer; Count,Sum,i : Longint; begin Result := False; Idx := stk.StIdx; {this should speed up and also made the code more readable} {check if enough parameters first parameter is number of throws for computing Pi} if Idx < 1 then Exit; Count := Trunc(Stk.Stack[Idx]); if Count > 625000000 then Exit; {parameter is too big and we get an overflow} Sum := 0; for i:=1 to Count do begin if (Sqr(Random)+Sqr(Random)) < 1 then Inc(Sum); end; {gives result back} Stk.Stack[Idx]:=4* Sum / Count; Result := True; end;
[Roadmap]
[Screenshots]
[Documentation]
[GPU Terragen]
[P2P Search Engine]
[Titan Movie]
[Seismograph]
[File Distributor]
[Eternity II]
[Orbit Simulation]
[Climate Simulation]
[Project/Contact]
[Download]
[FAQ]
Seeschloss created the initial website. The logo was designed by Mark Grady. Graphics are by David A. Lucas.
GPU, a P2P-computing cluster software, © 2002-2015 by the GPU Development team |