Pi calculator in Java using multithreading techniques.
Note: Tested only on Windows. Possible UI problems under Linux
-
You need to have installed Java SDK
-
Execute the pi.jar using the command:
java -jar pi.jar
Optional parameters:
- -p 1000 or --terms 1000
~ Sets the number of terms that it has to calculate. Ex. 1000 - -t 4 or --threads 4
~ Sets the number of thread to be used in the calculation. Ex 4 - -o pi.txt or --out pi.tx
~ Sets an output file to the calculated Pi - -q or --quiet
~ Puts the program in quiet mode. The ui will not be started and the return value will be the time needed to compute the Pi. The Pi itself will go in the file specified using '-o'
- Pi calculation - using Ramanujan's Formula for Pi
- UI - using Swing