Skip to content

Nefari0uss/calculate-pi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Calculate Pi using Leibniz's Formula

Author: nefari0uss

language java Open Source Love Build Status

Summary

This program will request the approximate number of calculations to run in calculating π. The final result will be displayed on the console. Does not use the Math class. Assumption is that the user inputs an int.

Uses the Gottfried Leibniz formula for calculation of π:

1 - 1/3 + 1/5 - 1/7 + 1/9 - ... = π/4

Source: Wikipedia - Leibniz formula for π

Instructions

  • Use the given make file.
  • Alternatively, compile: $ javac Pi.java
  • Run: $ java Pi

Asciicast

asciicast

Releases

No releases published

Packages

No packages published