Skip to content

Instantly share code, notes, and snippets.

@jstiehl
jstiehl / pi.go
Created August 30, 2019 23:25
Estimate Pi by randomly generating points in a 1x1 square and finding fraction of points that fall within a 1/4 circle of radius 1
package main
import (
"fmt"
"math"
"math/rand"
)
func main() {
converged := false