https://github.com/dimchansky/pi-gen-go
The implementation of algorithm for generating the digits of π sequentially in pure Go
https://github.com/dimchansky/pi-gen-go
digits-of-pi golang pi
Last synced: 5 months ago
JSON representation
The implementation of algorithm for generating the digits of π sequentially in pure Go
- Host: GitHub
- URL: https://github.com/dimchansky/pi-gen-go
- Owner: dimchansky
- License: apache-2.0
- Created: 2020-02-06T15:50:48.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-02-06T17:41:36.000Z (over 6 years ago)
- Last Synced: 2025-06-12T21:54:44.031Z (about 1 year ago)
- Topics: digits-of-pi, golang, pi
- Language: Go
- Homepage:
- Size: 17.6 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pi-gen-go [![GoDoc][1]][2] [![Build Status][3]][4] [![Go Report Card][5]][6] [![Coverage Status][7]][8]
[1]: https://godoc.org/github.com/dimchansky/pi-gen-go?status.svg
[2]: https://godoc.org/github.com/dimchansky/pi-gen-go
[3]: https://travis-ci.org/dimchansky/pi-gen-go.svg?branch=master
[4]: https://travis-ci.org/dimchansky/pi-gen-go
[5]: https://goreportcard.com/badge/github.com/dimchansky/pi-gen-go
[6]: https://goreportcard.com/report/github.com/dimchansky/pi-gen-go
[7]: https://codecov.io/gh/dimchansky/pi-gen-go/branch/master/graph/badge.svg
[8]: https://codecov.io/gh/dimchansky/pi-gen-go
The implementation of algorithm for generating the digits of π sequentially in pure Go.
## Example
The [simplest program](./cmd/printpi/main.go) that outputs all digits of π in an infinite loop:
```go
package main
import (
"fmt"
pigen "github.com/dimchansky/pi-gen-go"
)
func main() {
g := pigen.New()
fmt.Print(g.NextDigit())
fmt.Print(".")
for {
fmt.Print(g.NextDigit())
}
}
```