Skip to content

Instantly share code, notes, and snippets.

@pgburt
Last active December 22, 2015 23:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pgburt/26f26e8fe9cb846c999c to your computer and use it in GitHub Desktop.
Save pgburt/26f26e8fe9cb846c999c to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"math"
)
func main() {
for n := 1; n <= 10; n++ {
leibnizNum := math.Pow(-1, float64(n)) / float64(2 * n + 1)
fmt.Println("val: ", leibnizNum)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment