Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Euler's number approximation in go #173

Merged
merged 3 commits into from
Oct 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,11 @@ Place: Dublin, Ireland </br>
Coding Experience: Python, Java, HTML, CSS, JS, Angular, Django, Spring
Email: [email protected]

Name: Kyrpa Jorik Loh </br>
Place: Liubartsi </br>
Coding Experience: Python, Java, JavaScript, Go </br>
Email: [email protected] </br>

Name: Eesh Tyagi </br>
Place: Bangalore, India </br>
Coding Experience: Javascript, React, PWA
Expand Down
13 changes: 13 additions & 0 deletions go/approximate_e.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package main
/*
Euler’s number approximation in go
*/
import "fmt"

func main(){
e := 0.0
eApprox(&e)
fmt.Println(e)
}

func eApprox(e *float64) {for factorial, i := 1.0, 0; i < 10000; *e, factorial, i = *e + 1 / factorial, factorial * float64(i) + 1.0, i + 1 {}}