Last active
November 1, 2016 10:37
-
-
Save angch/39dab89321d170e20d38da3bbd307a94 to your computer and use it in GitHub Desktop.
Naive Go factorial. Can't run in Go playground, too slow.
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
// real 0m0.638s | |
// user 0m0.621s | |
// sys 0m0.015s | |
package main | |
import ( | |
"fmt" | |
"math/big" | |
) | |
func f(n int64) *big.Int { | |
ret := big.Int{} | |
return ret.MulRange(1, n) | |
} | |
func main() { | |
fmt.Println(f(100000)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment