Created
September 1, 2014 22:47
-
-
Save rvandervort/d42a5d03636e0a3ef6fe to your computer and use it in GitHub Desktop.
Project Euler : 48
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "math" | |
import "fmt" | |
func ret(base float64) float64 { | |
if base == 1 { | |
return 1 | |
} else { | |
return ret(base - 1) + math.Pow(base, base) | |
} | |
} | |
func main() { | |
fmt.Printf("Result is: %E\n", ret(float64(1000))) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
not sure why this prints :
"Result is: +Inf"