File tree Expand file tree Collapse file tree 2 files changed +34
-1
lines changed
Expand file tree Collapse file tree 2 files changed +34
-1
lines changed Original file line number Diff line number Diff line change 11build /
2+ pi
Original file line number Diff line number Diff line change 11# Pi Estimation
22
3- Estimates the value of π using a Monte Carlo simulation .
3+ Estimates the value of π using the [ Monte Carlo method ] ( https://en.wikipedia.org/wiki/Monte_Carlo_method ) .
44
55## Method
66
77We generate random points within the unit square and count how many fall within a circle of radius 1 centered at the origin.
88The ratio of the number of points within the circle to the total number of points approaches π/4.
99
1010![ Illustration of a Monte Carlo simulation] ( ./readme_images/monte-carlo.svg )
11+
12+ ## Run Estimation
13+
14+ Build and run an estimation with the default configuration.
15+
16+ ``` shell
17+ go build ./cmd/pi
18+ ./pi
19+ ```
20+
21+ Use the ` --help ` flag to see configuration options.
22+
23+ ``` shell
24+ ./pi --help
25+ ```
26+
27+ ## Development
28+
29+ 1 . Run tests
30+ ``` shell
31+ go test ./...
32+ ```
33+
34+ 1. Check formatting
35+ ` ` ` shell
36+ gofmt -d .
37+ ` ` `
38+
39+ 1. Check linking
40+ ` ` ` shell
41+ go vet ./...
42+ ` ` `
You can’t perform that action at this time.
0 commit comments