Skip to content
/ GoPi Public

Some basic Golang code that computes pi up to float64 precision.

Notifications You must be signed in to change notification settings

sdrafahl/GoPi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

GoPi

Simple Golang project that computes PI using the Leibniz infinite series.

https://en.wikipedia.org/wiki/Leibniz_formula_for_%CF%80

Setup

  1. Make Directory Structure

ProjectName -> bin

ProjectName -> src

src -> github.com

github.com -> <Github Username>

<Github Username> -> <Namespace>

  1. Export OS Variables

For this project here are the commands run to setup the system variables.

export GOPATH=$HOME/code/goPi

export PATH=$PATH:GOPATH/code/goPi/bin

  1. To Install

go install github.com/sdrafahl/pi

This installs the go project in the hello namespace and put it in the bin directory.

  1. To Run

After installing there should be an executable in the bin directory.

Tutorial Video

https://youtu.be/2KmHtgtEZ1s

Running

After you have compiled the project you can navigate to the bin directory
and execute the pi executable. The first command line argument to give is the number of iterations.

For example

./pi 1000

Runs the program 1000 iterations for the Leibniz forumula.

About

Some basic Golang code that computes pi up to float64 precision.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages