PI (Ï€) Algorythm using Leibniz Formula. How to use: That's fairly simple: Compile using: g++ main.cpp -o main. Run using ./main. Enter the number of decimals you want to print. Optional: You can change the precision level in main.cpp. You can find more details about Leibniz Formula here.